2.10.0
Use this when you need to respond to server requests for user input during tool execution.
Elicitation allows MCP servers to request structured input from users during operations. Instead of requiring all inputs upfront, servers can interactively ask for missing parameters, request clarification, or gather additional context.
Handler Template
How It Works
When a server needs user input, it sends an elicitation request with a message prompt and a JSON schema describing the expected response structure. FastMCP automatically converts this schema into a Python dataclass type, making it easy to construct properly typed responses without manually parsing JSON schemas. The handler receives four parameters:Handler Parameters
The prompt message to display to the user
A Python dataclass type that FastMCP created from the server’s JSON schema. Use this to construct your response with proper typing. If the server requests an empty object, this will be
None.The original MCP elicitation parameters, including the raw JSON schema in
params.requestedSchemaRequest context containing metadata about the elicitation request
Response Actions
You can return data directly, which implicitly accepts the elicitation:ElicitResult for explicit control over the action:
accept: User provided valid input. Include the data in thecontentfield.decline: User chose not to provide the requested information. Omitcontent.cancel: User cancelled the entire operation. Omitcontent.

