Handle server-initiated user input requests with structured schemas.
New in version: 2.10.0
elicitation_handler
function when creating the client. FastMCP automatically converts the server’s JSON schema into a Python dataclass type, making it easy to construct the response:
None
.params.requestedSchema
if you need itElicitResult
object for more control over the response action:
accept
: User provided valid input - include their data in the content
fielddecline
: User chose not to provide the requested information - omit content
cancel
: User cancelled the entire operation - omit content