Enable user input requests for MCP tools
elicitation_callback
function when initializing the MCPClient:
Parameter | Type | Description |
---|---|---|
context | RequestContext | Request context containing metadata about the elicitation request |
params | ElicitRequestParams | The MCP elicitation request parameters containing the message and optional schema |
Field | Type | Description |
---|---|---|
message | str | The prompt message to display to the user |
requestedSchema | dict | None | Optional JSON schema defining the expected response structure |
ElicitResult
object that specifies how the user responded:
Field | Type | Description |
---|---|---|
action | Literal['accept', 'decline', 'cancel'] | How the user responded to the elicitation request |
content | dict | str | None | The user’s input data (required for “accept”, omitted for “decline”/“cancel”) |
content
fieldcontent
content