CallToolRequest extends Request
FinalYes
Used by the client to invoke a tool provided by the server.
Tags
Table of Contents
Properties
- $arguments : array<string|int, mixed>
- $name : string
- $id : string|int
- $meta : array<string, mixed>|null
Methods
- __construct() : mixed
- fromArray() : static
- getId() : string|int
- getMeta() : array<string, mixed>|null
- getMethod() : string
- jsonSerialize() : RequestData
- requiresJsonTypes() : bool
- Whether the request cannot be served from params that lost the difference between `{}` and `[]`.
- withId() : static
- withMeta() : static
- fromParams() : static
- getParams() : stdClass}
- paramsToArray() : array<string, mixed>
Properties
$arguments read-only
public
array<string|int, mixed>
$arguments
$name read-only
public
string
$name
$id
protected
string|int
$id
$meta
protected
array<string, mixed>|null
$meta
= null
Methods
__construct()
public
__construct(string $name, array<string, mixed> $arguments) : mixed
Parameters
- $name : string
-
the name of the tool to invoke
- $arguments : array<string, mixed>
-
the arguments to pass to the tool; when decoded from JSON, nested objects are
\stdClassand nested arrays are lists
fromArray()
public
static fromArray(RequestData $data) : static
Parameters
- $data : RequestData
Return values
staticgetId()
public
getId() : string|int
Return values
string|intgetMeta()
public
getMeta() : array<string, mixed>|null
Return values
array<string, mixed>|nullgetMethod()
public
static getMethod() : string
Return values
stringjsonSerialize()
public
jsonSerialize() : RequestData
Return values
RequestDatarequiresJsonTypes()
Whether the request cannot be served from params that lost the difference between `{}` and `[]`.
public
static requiresJsonTypes() : bool
Return values
boolwithId()
public
withId(string|int $id) : static
Parameters
- $id : string|int
Return values
staticwithMeta()
public
withMeta(array<string, mixed>|null $meta) : static
Parameters
- $meta : array<string, mixed>|null
Return values
staticfromParams()
protected
static fromParams(array<string|int, mixed>|null $params) : static
Parameters
- $params : array<string|int, mixed>|null
Return values
staticgetParams()
protected
getParams() : stdClass}
Return values
stdClass}paramsToArray()
protected
static paramsToArray(stdClass $params) : array<string, mixed>
Parameters
- $params : stdClass