Topic 2 of 5 · 6 min read
Multi round-trip requests and input_required results
Goal: Trace a multi round-trip exchange and find the step where a client or server mishandles the retry or the request state.
In the 2026-07-28 revision, a server that needs more input ends the request with an input_required result, and the client retries the same call with the answers and the server's requestState. There is no separate server-to-client message any more.
Check yourself · 1 of 3
A tool call needs one more answer from the user. In the 2026-07-28 revision, how does the server ask for it?
Why it matters
Before this revision, servers sent their own requests to the client in the middle of a call. That needed a live session and shared storage across server instances. The multi round-trip pattern (MRTR) makes every step an ordinary independent request, so a stateless server behind a load balancer can still ask questions. The changelog calls the move away from server-initiated requests a breaking change.
How the exchange works
- The client sends
tools/call. Servers may also returninput_requiredforprompts/getandresources/read, and for nothing else. - The server answers with
resultType: "input_required". It carriesinputRequests, a map of server-chosen keys to elicitation, sampling or roots requests, and usually arequestState. At least one of the two must be present. - The client collects the answers, then retries the original call with
inputResponses(same keys) and the exactrequestState. The retry uses a new JSON-RPCid. - The server rebuilds its context from the retry alone and either completes or asks again. If an answer is missing, it asks again instead of returning an error.
Treat requestState as hostile
requestState is an opaque string only the server understands. The client must echo it back unchanged and must not parse it. Because it passes through the client, the server must treat it as attacker-controlled input. When it influences authorization or business logic, protect it with an HMAC or AEAD and reject anything that fails verification. Put the user, a short expiry and the originating request into the protected payload. These bound replay but do not make state single-use, so a one-time action needs a server-side check.
Before and after
Weak: the server keeps the half-finished order in memory and sends a bare retry.
{ "resultType": "input_required",
"inputRequests": { "size": { "method": "elicitation/create", "params": { "message": "Which size?", "requestedSchema": { "type": "object", "properties": { "size": { "type": "string" } } } } } } }
The second instance behind the load balancer has never seen the order. Fixed: add "requestState": "<AEAD blob with order id, user, expiry>" so any instance can resume.
What goes wrong
- Client edits the state. A client that decodes and "fixes"
requestStatebreaks verification or, worse, finds a server that never verified it. - Reused ids. Sending the retry with the old JSON-RPC
idtreats two requests as one. - Unsupported requests. Sending an elicitation to a client that did not declare the capability.
Examples
A traced exchange
// 1. client -> server (id 1)
{ "method": "tools/call", "params": { "name": "book_room", "arguments": { "date": "2026-09-03" } } }
// 2. server -> client
{ "id": 1, "result": { "resultType": "input_required",
"inputRequests": { "floor": { "method": "elicitation/create", "params": { "message": "Which floor?", "requestedSchema": { "type": "object", "properties": { "floor": { "type": "integer" } } } } } },
"requestState": "v1.8f3a..." } }
// 3. client -> server (id 2, same method and arguments)
{ "method": "tools/call", "params": { "name": "book_room", "arguments": { "date": "2026-09-03" },
"inputResponses": { "floor": { "action": "accept", "content": { "floor": 4 } } },
"requestState": "v1.8f3a..." } }
The retry keeps the original arguments, adds the answer under the key floor, and echoes the state.
Replay across users
A server signs requestState but leaves out the user. Alice's refund confirmation state is copied by Bob, who submits it on his own session and refunds Alice's order. Including the authenticated user, a short expiry and a digest of the request in the signed payload makes the server reject it.
Key points
- A server needing input returns an input_required result instead of sending its own request mid-call.
- The client retries the same method with inputResponses keyed like the inputRequests and a new JSON-RPC id.
- requestState is opaque to the client, which must echo it back exactly and never parse or change it.
- Servers must treat requestState as attacker-controlled and verify its integrity when it affects access or logic.
- Every input_required result must carry inputRequests, requestState or both.
- Only tools/call, prompts/get and resources/read may return input_required.
Common mistakes
- Storing half-finished work in server memory instead of in requestState, which breaks behind a load balancer.
- Using an unsigned requestState that carries an order id or a permission decision.
- Reusing the first JSON-RPC id on the retry.
- Dropping the original arguments on the retry and sending only the answers.
Check yourself · 2 of 3
A client gets requestState "v1.8f3a..." in an input_required result. What must it do on the retry?
Check yourself · 3 of 3
A server puts a signed order id in requestState but not the user's identity or an expiry. What is the risk?
Practice items, not counted towards your mastery.
Start here
- MCP elicitation specification (2026-07-28) (opens in a new tab)StandardFree
The normative rules for form and URL mode, the flat schema subset and what clients must show the user.
- MCP multi round-trip requests (2026-07-28) (opens in a new tab)StandardFree
Defines InputRequiredResult, inputRequests, inputResponses and the integrity rules for requestState.
- MCP Tasks extension overview (opens in a new tab)DocsFree
Task lifecycle, tasks/get polling, tasks/update input and when a server should return a task.