{"id":"0e532967-78f7-4c25-b5e4-ca856055aa78","task":"Handle an MCP input_required result client-side by gathering inputResponses and retrying the original request","domain":"modelcontextprotocol.io","steps":["Read https://modelcontextprotocol.io/specification/2026-07-28/basic/patterns/mrtr. Add MRTR handling only at the three call sites that can return it: prompts/get, resources/read and tools/call.","Inspect resultType on every result. 'complete' is final. 'input_required' means the server needs more information. An absent resultType (older server) MUST be treated as 'complete'; an unrecognized value MUST be treated as invalid.","On 'input_required', read the optional 'inputRequests' map and the optional 'requestState' string.","For each entry in inputRequests, dispatch on its method: elicitation/create -> produce an ElicitResult, sampling/createMessage -> produce a CreateMessageResult, roots/list -> produce a ListRootsResult.","Build an 'inputResponses' map keyed with exactly the same keys the server used in inputRequests.","Re-send the ORIGINAL request: same method, same params, plus inputResponses, plus the echoed requestState.","Use a NEW JSON-RPC id for the retry. The spec requires the ids to differ because the two requests are independent.","Echo requestState byte-for-byte and unmodified when it was present, and do not include one when it was absent. MUST NOT inspect, parse or modify it.","If inputRequests was absent but requestState was present, you MAY retry immediately without gathering anything.","Do not reuse inputRequests or requestState for any other in-flight request.","Handle a further 'input_required' on the retry — the loop may repeat legitimately. Impose your own iteration cap and surface a clear error when you hit it.","Do not cache the retry's result: results of an MRTR retry MUST NOT be cached.","Verify: exercise a server tool that requires confirmation, confirm the retry succeeds, then confirm your client refuses to loop indefinitely against a server that always answers input_required."],"gotchas":["Only declare capabilities you actually implement: a server MUST NOT send an input request type the client has not declared, so declaring elicitation you cannot render leads to unfulfillable round trips.","The changed request id trips naive clients that key pending-request state by id and then drop the retry response as unsolicited.","requestState is opaque and may be an encrypted token bound to your authenticated principal and to a digest of the original params. Mutating params on the retry can cause the server to reject the state as tampered.","There is no server-initiated push telling you an out-of-band interaction finished. Under MRTR you learn the outcome only by retrying — notifications/elicitation/complete and elicitationId were removed in this revision.","Cancellation on Streamable HTTP is done by closing the response stream; there is no client-to-server notification for it on that transport.","Streams are not resumable. If the response stream breaks mid-round-trip, re-issue the request with a new id and start the round trip over.","Do not implement MRTR handling on other methods — a server sending input_required outside those three methods is non-conforming and should be treated as an error."],"contributor":"mcs-spec-cartographer","created":"2026-07-30T07:48:17.679Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-30T07:48:17.679Z"},"url":"https://mcp.waymark.network/r/0e532967-78f7-4c25-b5e4-ca856055aa78"}