Asking the user: elicitation and multi round-trip requests — Cheat Sheet
MCP Engineering course · M1
This cheat sheet covers the one active client feature in MCP revision 2026-07-28, elicitation, and the mechanism that carries it: multi round-trip requests (MRTR). It also lists the client features that are now deprecated or removed, so you can recognise them in older material.
What changed in V2: the earlier version of this sheet taught sampling, roots and elicitation as three equal "client primitives". In 2026-07-28, sampling and roots are deprecated, and servers no longer send requests to clients. Elicitation is the only active client feature.
In one sentence
A server that needs something from the user in the middle of a request does not call the client: it returns an InputRequiredResult, the client asks the user, and then retries the original request with the answers.
The two elicitation modes (current, 2026-07-28)
| Mode | What the server sends | Where the data goes | Use it for |
|---|---|---|---|
| Form | a message and a requestedSchema | through the client, which renders a form | non-sensitive input: a confirmation, a date, a seat preference |
| URL | a message and a url | to a browser page, outside the client | anything sensitive: passwords, API keys, tokens, payment credentials, a third-party OAuth grant |
The client declares support on every request, in _meta:
{"_meta":{"io.modelcontextprotocol/clientCapabilities":{"elicitation":{"form":{},"url":{}}}}}
An empty "elicitation": {} means form mode only. Servers MUST NOT send a mode the client did not declare.
Never ask for secrets in a form
- Servers MUST NOT use form mode to request "passwords, API keys, access tokens, or payment credentials", and MUST use URL mode for those interactions.
- A name or email is not categorically forbidden; the user must be able to review and decline.
- URL mode rules: clients MUST NOT pre-fetch the URL or open it without explicit consent, and MUST show the full URL first. Servers MUST NOT put credentials or personal data in the URL, MUST NOT send pre-authenticated URLs, and MUST verify that whoever opens the URL is the user who triggered the request.
- URL mode is not how the client authorises to your server (that is OAuth, L13).
Multi round-trip requests, step by step
- The client sends a normal request:
tools/call,prompts/getorresources/read(only these three may get an input-required reply). - The server answers with
resultType: "input_required", aninputRequestsmap and, optionally, an opaquerequestState. - The client asks the user, then retries the original request with a new JSON-RPC
id, addinginputResponses(same keys) and echoingrequestStateexactly. - The server completes (
resultType: "complete"), or asks again.
Each round is independent, so any server instance can handle the retry: no shared session storage, no sticky load balancing.
Security of requestState: the client MUST NOT inspect or modify it; the server MUST treat it as attacker-controlled and, if it influences authorisation or business logic, protect its integrity (HMAC or AEAD) and reject state that fails verification. Bind it to the principal, a short expiry and the originating request. Never assume the client will answer or retry.
Worked example: confirm before releasing a reservation
Official Python SDK mcp 2.3.0. A resolver returns an Elicit marker; the SDK turns it into an InputRequiredResult for 2026-07-28 clients (and sends a legacy mid-call request to 2025-11-25 clients):
from typing import Annotated
from pydantic import BaseModel, Field
from mcp.server.mcpserver import MCPServer, Elicit, Resolve, ElicitationResult, AcceptedElicitation
class Confirm(BaseModel):
confirm: bool = Field(description="Release the reservation?")
mcp = MCPServer("demo-orders", version="1.0.0")
def ask(sku: str):
return Elicit(f"Release the reservation for {sku}? This changes stock.", Confirm)
@mcp.tool(name="release_reservation")
def release_reservation(
sku: Annotated[str, Field(pattern=r"^[A-Z]{3}-\d{4}$")],
answer: Annotated[ElicitationResult[Confirm], Resolve(ask)],
) -> str:
"""Release a demo reservation after the user confirms."""
if isinstance(answer, AcceptedElicitation) and answer.data.confirm:
return f"Released reservation for {sku}."
return f"Nothing changed for {sku} ({answer.action})."
if __name__ == "__main__":
mcp.run("streamable-http", host="127.0.0.1", port=8795, streamable_http_path="/mcp")
answer is filled by the resolver, not the model, so it does not appear in the tool's inputSchema. Round 1 reply (captured 2026-11-26, requestState shortened):
{"jsonrpc":"2.0","id":2,"result":{"resultType":"input_required",
"inputRequests":{"__main__:ask":{"method":"elicitation/create","params":{
"mode":"form","message":"Release the reservation for ELC-0002? This changes stock.",
"requestedSchema":{"type":"object","properties":{"confirm":{"type":"boolean","title":"Confirm","description":"Release the reservation?"}},"required":["confirm"]}}}},
"requestState":"v1.JMczrwXc...Rhyvw"}}
Round 2, a retry with a new id:
{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"release_reservation",
"arguments":{"sku":"ELC-0002"},
"inputResponses":{"__main__:ask":{"action":"accept","content":{"confirm":true}}},
"requestState":"v1.JMczrwXc...Rhyvw",
"_meta":{ "...same as round 1..." }}}
The key __main__:ask is chosen by the SDK; clients must treat keys as opaque.
The outcomes you must handle
| Situation | Result in the lab run |
|---|---|
"action":"accept" with confirm: true | resultType: "complete", Released reservation for ELC-0002. |
"action":"decline" | Nothing changed for ELC-0002 (decline). |
"action":"cancel" | Nothing changed for ELC-0002 (cancel). |
tampered requestState | error -32602, "Invalid or expired requestState" |
client did not declare elicitation | HTTP 400 with error -32021 (MissingRequiredClientCapability) and data.requiredCapabilities |
Deprecated and removed client features (legacy box)
| Feature | Status in 2026-07-28 | Migration path (deprecated features registry) |
|---|---|---|
Sampling (sampling/createMessage) | Deprecated (SEP-2577); earliest removal: first revision on or after 2027-07-28 | "Integrate directly with LLM provider APIs" |
Roots (roots/list) | Deprecated (SEP-2577) | "Pass directories or files via tool parameters, resource URIs, or server configuration" |
Logging (notifications/message) | Deprecated (SEP-2577); logging/setLevel removed | "Log to stderr for stdio transports; use OpenTelemetry for observability" |
Server-initiated requests (e.g. elicitation/create sent by the server) | Removed; replaced by MRTR | Return InputRequiredResult |
notifications/elicitation/complete, URL-mode elicitationId, error -32042 | Removed (all were new in 2025-11-25) | Retry the original request; correlate through requestState |
Deprecated features still work during the deprecation window; new servers should not add them. Roots never sandboxed anything: they only told a server where to work. Enforce any boundary inside the server (tool parameters, configuration) and with operating-system restrictions.
Glossary
- Elicitation: a server asking the user for input during a request; the user can accept, decline or cancel.
InputRequiredResult: a result withresultType: "input_required"and aninputRequestsmap.- MRTR (Multi Round-Trip Requests): the 2026-07-28 pattern of reply-then-retry that replaced server-initiated requests.
inputResponses: the answers the client adds to the retry, under the same keys asinputRequests.requestState: opaque server state echoed by the client; attacker-controlled from the server's point of view.-32021: the error for a missing required client capability.
To remember
- Elicitation is the only active client feature in 2026-07-28; sampling, roots and logging are deprecated.
- Servers never send requests: they return
InputRequiredResult, and the client retries with a newid. - Form mode never asks for secrets; passwords, API keys, tokens and payment data go through URL mode.
- Handle accept, decline and cancel, and the
-32021missing-capability error. - Treat
requestStateas attacker-controlled: verify its integrity if it drives decisions.
Turning Point Academy · MCP Engineering course · Module 1 · Lesson 5 (L05) · V2, spec 2026-07-28