# How should an instance treat MCP elicitation replies as untrusted state transitions, not resumptions of a suspended call **Date of Record:** 2026 November 25 **Scope:** Applies to MCP servers that issue `elicitation/create` requests to the client mid-tool-call during long-running agentic sessions, and to the client/agent runtime that must resume the suspended tool invocation after the human (or orchestrator) replies. Does not cover synchronous request/response tools that never yield control, nor sampling (`sampling/createMessage`) flows, which have a different trust topology. ## Core Distinction The elicitation round-trip *looks* like a coroutine suspension: the server yields a `elicitation/create` request, the client collects input, and the server's `tools/call` handler resumes with the answer. The failure mode lives in the gap between that appearance and the actual mechanism. MCP elicitation is not a suspended stack frame — it is a **request/response pair over a stateful session**, and the server-side handler that resumes is a *fresh* continuation that re-reads session state. Between the moment the server emitted the elicitation and the moment the client's `elicitation/result` arrives, the session is a mutable shared object: the agent may have issued other tool calls, context may have been compacted, the human may have taken minutes, and the server may have garbage-collected or timed out the pending elicitation id. The invariant that operators assume and that is *not* enforced by the protocol: **the state the server resumes into is identical to the state it suspended from, and the reply is bound to the exact call that requested it.** Neither holds by default. The reply is a bare JSON value keyed by an elicitation id; nothing in the wire format ties it to the call's epoch, the tool schema version that was active when the question was asked, or the human's authority to answer it. ## What Was Observed A long-running `deploy_pipeline` tool on an MCP server asks for confirmation before a destructive step. The handler emits `elicitation/create` with `{id: "el_7f3a", message: "Confirm rollback of prod cluster?", requestedSchema: {type: "object", properties: {confirm: {type: "boolean"}}}}`. The client surfaces this to a human via a UI. The human is slow — 4 minutes. During those 4 minutes: 1. The agent, unaware that a call is suspended, issues a second `tools/call` (`deploy_pipeline` again, different target) on the same session. The server accepts it (MCP does not serialize concurrent calls on one session by default) and that second call *also* emits an elicitation, `el_9c11`. 2. The client's elicitation UI, built as a simple queue, displays `el_9c11` first because the second call's question arrived while the first was still on screen and the renderer re-sorted by recency. The human answers "yes, confirm" — intending `el_7f3a`. 3. The client sends `elicitation/result` with `{id: "el_9c11", action: "accept", content: {confirm: true}}`. 4. The server resumes the *second* call's continuation with `confirm: true` and proceeds to roll back the *wrong* cluster. The first call's continuation remains pending and later times out, returning an `isError` result that the agent interprets as "rollback failed," triggering a retry that compounds the damage. The observable failure is not a crash. It is a **silent misbinding**: a valid reply, correctly formatted against the schema, delivered to a valid pending elicitation id, applied to the wrong suspended call. The schema validation passed. The id matched a live pending request. Every layer did what it was specified to do. A second, subtler variant: the human answers `el_7f3a` correctly, but by the time the reply arrives the agent's context window has been compacted and the tool's schema was renegotiated (the server advertised a new `inputSchema` on a `tools/list_changed` notification, and the client re-fetched). The resumed handler validates the reply against the *new* schema, in which `confirm` was renamed `acknowledge`. The reply `{confirm: true}` fails validation, the handler returns `isError`, and the agent — seeing a validation error on a tool it believes is mid-execution — re-enters the tool from the top, re-emitting the elicitation. The human is asked to confirm the rollback a second time, and now confirms reflexively. ## Condition of Validity The "resume" semantics of elicitation are only sound when **all four** of the following hold simultaneously: - **Single in-flight call per session.** If the client or server permits more than one `tools/call` to be pending on a session concurrently, elicitation ids are no longer sufficient disambiguators because the *client-side UI mapping* from question to id is not guaranteed stable across re-renders. - **Elicitation id is a capability, not a label.** The reply must be cryptographically or structurally bound to the request — e.g., the server issues the elicitation id as a one-time token and rejects any `elicitation/result` whose id does not match a pending request *and* whose embedded call-epoch nonce does not match the epoch captured at emission. - **Schema stability across the gap.** The `requestedSchema` presented to the human must be the schema the reply is validated against. If the tool's schema can change while an elicitation is pending, the pending elicitation must be *invalidated* (server sends `notifications/cancelled` for the elicitation, client discards the pending UI), not silently re-validated against the new schema. - **Continuation state is checkpointed, not re-derived.** The server handler must persist the exact state it suspended from (target cluster id, epoch, partial results) keyed by elicitation id, and resume from that checkpoint — not from a re-read of session state that may have advanced. In practice, most MCP deployments satisfy *none* of these. The protocol as written leaves the binding to the implementation, and the default client SDKs treat elicitation as a UI concern rather than a state-transition concern. ## Decision Boundary The boundary an instance must draw is between **treating the elicitation reply as a resumption** and **treating it as a new, untrusted input event that must re-establish its own context.** Concretely: - If the runtime can guarantee single-in-flight and id-as-capability, it may resume the suspended continuation directly, passing the reply through schema validation *against the schema captured at emission time*, not the current advertised schema. - If it cannot guarantee those, the resumed handler must **re-validate preconditions from scratch**: re-read the target, re-check that the operation is still safe to perform, and confirm that the human's answer was solicited for *this* target. The reply is a hint, not an authorization. - Any elicitation whose reply arrives after a `tools/list_changed` affecting the tool, or after a context compaction that dropped the original question from the agent's visible history, must be **discarded and re-elicited**, never applied. The failure to draw this boundary — the assumption that the continuation is a coroutine resume — is what produces the silent misbinding. The guardrail is a **reply-binding check**: the server, on receiving `elicitation/result`, must verify `(elicitation_id, call_epoch, schema_hash)` against the checkpoint it stored at emission. If any component mismatches, the server raises a binding error, cancels the suspended continuation, and returns `isError` with a machine-readable cause — it does not guess, and it does not fall through to a default. ## Operational Effect With reply-binding checks in place, the misbinding variant becomes a loud, recoverable error: the human's "yes" for `el_7f3a` is rejected against `el_9c11`'s checkpoint because the call-epoch nonce differs, the second call's continuation is cancelled, and the agent receives a structured `ELICITATION_BINDING_MISMATCH` that it can route to a re-prompt rather than a retry. The schema-drift variant becomes a `SCHEMA_HASH_MISMATCH` that invalidates the stale elicitation and forces a clean re-elicitation with the current schema — the human sees a fresh, correctly-labeled question rather than a reflexive second confirmation. The cost is that some legitimate long-running flows now surface an error where they previously "worked" by luck. That is the correct trade: the previous success was a success on the happy path where no concurrent call, no compaction, and no schema change intervened. The binding check converts an unbounded class of silent wrong-target actions into a bounded class of explicit, retryable failures. For any tool that performs irreversible operations, that conversion is the entire point — an elicitation is an authorization gate, and an authorization gate that can be answered by the wrong question is not a gate. ```python import hashlib import json from dataclasses import dataclass class ElicitationBindingError(RuntimeError): """Raised when an elicitation reply cannot be bound to the call that requested it.""" @dataclass(frozen=True) class ElicitationCheckpoint: elicitation_id: str call_epoch: str schema_hash: str target: str def _hash_schema(schema: dict) -> str: return hashlib.sha256( json.dumps(schema, sort_keys=True, separators=(",", ":")).encode() ).hexdigest() def bind_elicitation_reply( reply: dict, checkpoints: dict[str, ElicitationCheckpoint], current_schema: dict, current_call_epoch: str, ) -> ElicitationCheckpoint: """Validate that a reply is bound to the exact suspended call it claims to answer. Refuses to resume when the reply's elicitation id is unknown, when the call epoch has advanced, or when the tool schema was renegotiated mid-gap. """ eid = reply.get("id") if eid not in checkpoints: raise ElicitationBindingError( f"reply references unknown or expired elicitation id {eid!r}; " "pending continuation must be cancelled, not resumed" ) cp = checkpoints[eid] if cp.call_epoch != current_call_epoch: raise ElicitationBindingError( f"elicitation {eid!r} was emitted in epoch {cp.call_epoch!r} but session " f"is now in epoch {current_call_epoch!r}; concurrent call interleaved, " "reply cannot be trusted to target the original call" ) if _hash_schema(current_schema) != cp.schema_hash: raise ElicitationBindingError( f"elicitation {eid!r} was presented under schema {cp.schema_hash[:12]} but " "tool schema changed via tools/list_changed; discard and re-elicit" ) if reply.get("action") not in ("accept", "decline", "cancel"): raise ElicitationBindingError( f"elicitation {eid!r} returned unrecognized action {reply.get('action')!r}" ) return cp def resume_suspended_call( reply: dict, checkpoints: dict[str, ElicitationCheckpoint], current_schema: dict, current_call_epoch: str, ) -> dict: cp = bind_elicitation_reply(reply, checkpoints, current_schema, current_call_epoch) if reply["action"] != "accept": return {"status": "aborted", "target": cp.target, "reason": reply["action"]} return {"status": "resumed", "target": cp.target, "content": reply.get("content", {})} ```