Topic 1 of 5 · 5 min read
Asking users for input with elicitation
Goal: Choose form or URL elicitation for a described input need and write a request that never collects a secret through the form.
Elicitation lets an MCP server pause a tool call and ask the user a question through the client: use form mode for plain answers and URL mode for anything secret.
Check yourself · 1 of 3
A server needs the user's payment card number to finish a purchase tool. Which elicitation approach does the spec require?
Why it matters
A create_release tool needs a version number, and a deploy tool needs a yes or no. Without elicitation the model guesses the missing argument, or the server fails with a vague error. Elicitation puts the question in front of the person who can answer it, in the client's own interface.
How to do it
- Check what the client supports. A client lists
elicitationin its capabilities withform,urlor both. An emptyelicitationobject means form mode only. Never send a mode the client did not declare. - Use form mode for simple answers. You send a
messageand arequestedSchema. The schema is a flat object: properties may be strings, numbers, booleans or enums, and the only arrays allowed are multi-select enums. No nesting. Strings may use the formatsemail,uri,dateanddate-time. Form data passes through the client. - Use URL mode for secrets. You send
mode: "url", amessageand aurl. The user opens the page in a browser, and the data they type never reaches the client. The spec says servers must not collect passwords, API keys, access tokens or payment credentials with a form. Name, email and username are not banned. - Handle three outcomes. The user can
accept(withcontentfor a form),declineorcancel. Decline and cancel are normal answers, not errors. - Remember what the client must show. It must say which server is asking, offer clear decline and cancel options, let the user edit a form before sending, and for URL mode show the target host and get consent first.
In the 2026-07-28 revision, the request travels inside an input_required result, which the next topic covers.
Before and after
Weak: the server asks for a key in a form.
{
"method": "elicitation/create",
"params": {
"mode": "form",
"message": "Paste your Stripe secret key",
"requestedSchema": {
"type": "object",
"properties": { "key": { "type": "string" } }
}
}
}
Fixed: the server sends the user to its own page.
{
"method": "elicitation/create",
"params": {
"mode": "url",
"message": "Connect your Stripe account to enable refunds",
"url": "https://billing.example.com/connect/stripe"
}
}
What goes wrong
- Secrets in a form. The key is now visible to the client and its logs.
- Nested schemas. A schema with an object inside an object is outside the allowed subset, and clients may reject it.
- Treating decline as failure. The tool should return a clear "cancelled by user" result, not retry the question.
Examples
A confirmation with a choice
A deploy tool asks which environment and whether to run migrations:
{
"mode": "form",
"message": "Deploy build 482?",
"requestedSchema": {
"type": "object",
"properties": {
"environment": { "type": "string", "enum": ["staging", "production"] },
"runMigrations": { "type": "boolean", "default": false }
},
"required": ["environment"]
}
}
Both fields are flat and need no secret, so form mode fits.
Third-party authorization
A calendar tool needs access to the user's Google Calendar. The server sends a URL-mode request pointing at its own OAuth start page. The client shows accounts.example.com, the user consents, and the token stays between the user's browser and the server. This is separate from the authorization between the client and the MCP server.
Key points
- Form mode collects simple structured answers through the client, and the data is visible to it.
- URL mode sends the user to a page in the browser, so the entered data never passes through the client.
- Servers must not request passwords, API keys, access tokens or payment credentials in form mode.
- A form schema is a flat object of strings, numbers, booleans and enums, with multi-select enums as the only arrays.
- A user can accept, decline or cancel, and the server must treat all three as valid outcomes.
- Clients must show which server is asking and, for URL mode, the target host before the user consents.
Common mistakes
- Asking for an API key or password in a form because the schema field is easy to write.
- Sending a URL-mode request to a client that declared only form mode.
- Designing a schema with nested objects or arrays of objects, which the flat subset does not allow.
- Treating decline or cancel as an error and asking the same question again.
Check yourself · 2 of 3
Which requestedSchema is allowed in a form-mode elicitation request?
Check yourself · 3 of 3
A user closes the dialog for a form-mode elicitation without answering. What should the server do?
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.