Phantom.Elicit (phantom_mcp v0.3.2)
View SourceThe Model Context Protocol (MCP) provides a standardized way for servers to request additional information from users through the client during interactions. This flow allows clients to maintain control over user interactions and data sharing while enabling servers to gather necessary information dynamically. Servers request structured data from users with JSON schemas to validate responses.
Error
Note: this is not yet tested
https://modelcontextprotocol.io/specification/2025-06-18/client/elicitation
sequenceDiagram
participant User
participant Client
participant Server
Note over Server,Client: Server initiates elicitation
Server->>Client: elicitation/create
Note over Client,User: Human interaction
Client->>User: Present elicitation UI
User-->>Client: Provide requested information
Note over Server,Client: Complete request
Client-->>Server: Return user response
Note over Server: Continue processing with new information
Summary
Types
@type number_property() :: %{ name: String.t(), required: boolean(), type: :number | :integer, title: String.t(), description: String.t(), minimum: pos_integer(), maximum: pos_integer() }
@type string_property() :: %{ name: String.t(), required: boolean(), type: :string, title: String.t(), description: String.t(), min_length: pos_integer(), max_length: pos_integer(), pattern: String.t() | Regex.t(), format: :email | :uri | :date | :datetime }
@type t() :: %Phantom.Elicit{ message: String.t(), requested_schema: [ number_property() | boolean_property() | enum_property() | string_property() ] }
Functions
@spec build(%{ message: String.t(), requested_schema: [ number_property() | boolean_property() | enum_property() | string_property() ] }) :: t()