MCP PHP SDK

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
author

Christopher Hertel mail@christopher-hertel.de

Tobias Nyholm tobias.nyholm@gmail.com

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()

Methods

isJsonObject()

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
Return values
bool
On this page

Search results