Clone MCP tools
Purpose, inputs, outputs and call timing for init_context, the prompt prediction tools, ask_question and feedback_loop.
On this page
Clone MCP exposes five tools. Clients list them under the server name you chose, for example clone_mcp.init_context or mcp__clone_mcp__init_context. Every result includes structuredContent that matches the tool's outputSchema and a short text summary for clients that show only text.
| Tool | Call it | Returns |
|---|---|---|
init_context | Once at the start of a conversation, before other Clone tools | session_id and the Clone context the user chose to share |
predict_first_prompts | When the user has not yet given a concrete request | Up to five ranked first prompts |
predict_followup_prompts | After the agent finishes a result, before handing control back | Up to five ranked feedback or next-request prompts |
ask_question | Instead of asking the user a clarifying question | The answer Clone expects from the user and whether the user must decide |
feedback_loop | When the user accepts, edits or rejects a prediction or answer | Confirmation that the feedback was recorded |
Clone returns suggestions for you to review and records their IDs for feedback. If a Clone tool fails, don't stop the task: Errors and limits says when to call Clone again and when to continue without it.
session_id is optional for the prediction tools and ask_question. Without it, Clone uses the context sent in that call and the Clone context the user shared.
init_context
Starts or resumes a Clone session for this conversation. It stores the conversation's starting context on Clone's server and returns the context sources the user selected when connecting the app.
{
"conversation_id": "host-thread-42",
"workspace": { "name": "clone", "kind": "repository", "summary": "React site and FastAPI server" },
"task": "Add a Clone MCP page to the developer site.",
"messages": [],
"instructions": "Prefer small pull requests. Write docs in English.",
"language": "auto"
}
All fields are optional. conversation_id makes the call idempotent: the same ID resumes the same session and returns a new context_revision when the context changed. workspace.kind is chat, repository, document or other. messages accepts up to 30 recent turns of up to 8,000 characters each, with role (user or assistant) and optional origin (human or agent). Send instructions only when they describe the user's own standing preferences.
{
"session_id": "mcp-session-example",
"context_revision": "1",
"user_context": {
"profile": [{ "id": "profile-1", "label": "Writing", "text": "Prefers concise Korean summaries." }],
"goals": [{ "id": "goal-1", "title": "Clone MCP design", "summary": "Design the server and docs." }]
},
"agent_guidance": "Ask Clone with ask_question before asking the user a clarifying question.",
"expires_at": 1790812860
}
user_context is empty when the user shared no sources. The session expires after seven days without activity; call init_context again with the same conversation_id to continue.
predict_first_prompts
Predicts how the user would start this session from the shared Clone context and the workspace. Use it when the opening message is empty or vague, such as "continue" or "what next?", or when your host shows starter suggestions.
{ "session_id": "mcp-session-example", "count": 3, "draft": "" }
count is 1–5 and defaults to 3. A nonempty draft (up to 8,000 characters) asks Clone to complete the text the user has started instead. Without a session_id, predictions use only the user's shared Clone context.
{
"status": "suggested",
"predictions": [
{ "prediction_id": "prediction-example-1", "rank": 1, "text": "Review the Clone MCP design and list open decisions." },
{ "prediction_id": "prediction-example-2", "rank": 2, "text": "Draft the docs page for the MCP tools." }
],
"expires_at": 1790812860
}
Show the predictions as options. Never send one as the user's message unless the user chooses it. An abstained result has an empty predictions list; continue normally.
predict_followup_prompts
Predicts the user's next message after the agent's latest result: feedback on that result, or the next request.
{
"session_id": "mcp-session-example",
"messages": [
{ "role": "user", "content": "Add a Clone MCP page.", "origin": "human" },
{ "role": "assistant", "content": "Added /mcp with connection steps and a tool list." }
],
"artifact": { "kind": "code", "title": "CloneMcp.tsx", "summary": "New page, route and nav entry." },
"count": 3
}
messages is required and holds at least one turn: the turns since your last Clone call, including the latest result. artifact is optional; when you send it, it needs both kind (code, document, image or other) and summary (up to 4,000 characters).
The result has the same shape as predict_first_prompts. Each prediction also has kind: feedback reacts to the latest result, and next_request moves the work forward. Offer the predictions to the user. Act on a prediction yourself only when the user has explicitly asked you to continue with Clone's suggestions.
ask_question
Asks Clone the question you would otherwise ask the user. The input matches AskUserQuestion, so an agent can send the same questions.
{
"session_id": "mcp-session-example",
"context": "Choosing storage for a local prototype.",
"questions": [
{
"question": "Which database should the prototype use?",
"header": "Database",
"multiSelect": false,
"options": [
{ "label": "SQLite", "description": "No server to run" },
{ "label": "Postgres", "description": "Matches production" }
]
}
]
}
Send one to four questions with two to four options each. Questions without options are allowed when a short text answer fits.
{
"answers": [
{
"question": "Which database should the prototype use?",
"prediction_id": "prediction-example-3",
"selected": ["SQLite"],
"text": "",
"confidence": "high",
"needs_user": false,
"basis": "Chose SQLite for the last two local prototypes."
}
],
"expires_at": 1790812860
}
confidence · high / medium / low. If needs_user is true, ask the user. Show a recommendation only when Clone supplied one. Ask the user before spending, deleting, executing code or installing software, changing access, affecting other people, or sharing data beyond the task. Ask Clone before the user
feedback_loop
Reports what the user did with a prediction or an answer. Unless learning is off for this app, edits and rejections teach the user's Clone and improve their later predictions and answers, also in their other apps that share the same Clone context. An accept is recorded but teaches nothing.
{
"session_id": "mcp-session-example",
"prediction_id": "prediction-example-3",
"result": "reject",
"answer": "Postgres",
"reason": "The prototype will share the production schema.",
"event_id": "feedback-001"
}
| Field | Required | Meaning |
|---|---|---|
session_id | No | Session that produced the prediction |
prediction_id | Yes | ID from a prediction or an ask_question answer |
result | Yes | accept: used unchanged. edit: used with changes. reject: dismissed or answered differently |
answer | For edit | What the user actually sent or chose, up to 4,000 characters |
reason | No | Why the user edited or rejected it, up to 1,000 characters |
event_id | No | Idempotency key; reuse it when retrying the same report |
Send reason and answer only from what the user actually said or did. Do not ask the user for a reason just to fill the field. Report each prediction once.
{ "status": "recorded", "event_id": "feedback-001" }
A retry with the same event_id and body returns duplicate. Feedback is encrypted, used only for this user's Clone and expires after 30 days. Whether an app's feedback teaches Clone is set for each app with a switch on the consent screen; to change it, connect the app again. In Connected apps, the user can disconnect an app or have Clone forget everything it learned from AI apps.
Errors and limits
Tool errors return isError: true and text that starts with a code. Recover as the table says, and never retry in a loop.
| Code | What to do |
|---|---|
invalid_arguments | The arguments do not match the tool's input schema: fix them and call again |
session_not_found | No Clone session has this session_id for this app: call init_context and use the session_id it returns |
session_expired | The session had no activity for seven days: call init_context again with the same conversation_id |
context_too_large | The context is over Clone's limits: send fewer or shorter turns |
rate_limited | Too many calls in a short time: wait the seconds the message names, or continue without Clone |
quota_exceeded | This week's Clones are used up: continue without Clone |
unavailable | Clone cannot answer right now: continue without Clone |
prediction_not_found | Clone has no prediction with this prediction_id: send the ID exactly as Clone returned it, or drop the report |
prediction_expired | The prediction expired before its feedback arrived: drop the report |
event_id_conflict | This event_id was already used for different feedback: send the report with a new event_id |
An expired or revoked sign-in returns HTTP 401; the client asks the user to connect again.