CallToolHandler implements RequestHandlerInterface
FinalYes
A tools/call answers with the tool's output or, under MRTR, with a request for the input it still needs.
Tags
Table of Contents
Interfaces
- RequestHandlerInterface
- Covariant in TResult: a handler only ever produces its result, so one declaring a concrete result type satisfies a collection of handlers typed by the interface every result implements.
Properties
- $logger : LoggerInterface
- $referenceHandler : ReferenceHandlerInterface
- $registry : RegistryInterface
- $schemaValidator : SchemaValidator
Methods
- __construct() : mixed
- handle() : Response<string|int, CallToolResult|InputRequiredResult>|Error
- supports() : bool
- isJsonObject() : bool
- Whether a `structuredContent` value encodes as a JSON object — the only shape revisions predating SEP-2106 accept.
Properties
$logger read-only
private
LoggerInterface
$logger
= new NullLogger()
$referenceHandler read-only
private
ReferenceHandlerInterface
$referenceHandler
$registry read-only
private
RegistryInterface
$registry
$schemaValidator
private
SchemaValidator
$schemaValidator
Methods
__construct()
public
__construct(RegistryInterface $registry, ReferenceHandlerInterface $referenceHandler[, LoggerInterface $logger = new NullLogger() ][, SchemaValidator|null $schemaValidator = null ]) : mixed
Parameters
- $registry : RegistryInterface
- $referenceHandler : ReferenceHandlerInterface
- $logger : LoggerInterface = new NullLogger()
- $schemaValidator : SchemaValidator|null = null
handle()
public
handle(Request $request, SessionInterface $session) : Response<string|int, CallToolResult|InputRequiredResult>|Error
Parameters
- $request : Request
- $session : SessionInterface
Return values
Response<string|int, CallToolResult|InputRequiredResult>|Errorsupports()
public
supports(Request $request) : bool
Parameters
- $request : Request
Return values
boolisJsonObject()
Whether a `structuredContent` value encodes as a JSON object — the only shape revisions predating SEP-2106 accept.
private
static isJsonObject(mixed $value) : bool
Parameters
- $value : mixed