Skip to main content
Elicitation allows your MCP server tools to request additional information from users during execution. This enables tools to gather structured or unstructured input when needed, creating interactive and dynamic workflows.

How It Works

When a tool needs user input, it can use the Context to send an elicitation request to the client. The client displays the request to the user and returns their response to the tool. The user can accept (provide data), decline (skip), or cancel the operation.

Basic Usage

Use the elicit() method on the context object to request user input:

Structured Input

Define schemas using dataclasses or Pydantic models for structured data collection:

Response Actions

Elicitation responses use a three-action model:
  • accept: User provided valid input - the data field contains their response
  • decline: User chose not to provide the information
  • cancel: User cancelled the entire operation

Use Case Example

A task management server that collects task details from users:

Important Notes

  • The client must provide an elicitation_callback to handle elicitation requests
  • If no callback is configured, elicitation requests will fail
  • Use dataclasses or Pydantic models for type-safe structured input
  • Handle all three response actions (accept, decline, cancel) appropriately

Next Steps