ElicitationRequestHandler implements RequestHandlerInterface
Handler for elicitation requests from the server.
The MCP server may request additional information from the user during tool execution. This handler wraps a user-provided callback that presents the requested schema to the user and returns their response.
Tags
Table of Contents
Interfaces
- RequestHandlerInterface
- Interface for handling requests from the server.
Properties
- $callback : ElicitationCallbackInterface
- $logger : LoggerInterface
Methods
- __construct() : mixed
- handle() : Response<string|int, ElicitResult>|Error
- Handle the request and return a response or error.
- supports() : bool
- Check if this handler supports the given request.
Properties
$callback read-only
private
ElicitationCallbackInterface
$callback
$logger read-only
private
LoggerInterface
$logger
= new NullLogger()
Methods
__construct()
public
__construct(ElicitationCallbackInterface $callback[, LoggerInterface $logger = new NullLogger() ]) : mixed
Parameters
- $callback : ElicitationCallbackInterface
- $logger : LoggerInterface = new NullLogger()
handle()
Handle the request and return a response or error.
public
handle(Request $request) : Response<string|int, ElicitResult>|Error
Parameters
- $request : Request
Return values
Response<string|int, ElicitResult>|Errorsupports()
Check if this handler supports the given request.
public
supports(Request $request) : bool
Parameters
- $request : Request