Tool
in package
implements
JsonSerializable
Definition for a tool the client can call.
Tags
Table of Contents
Interfaces
- JsonSerializable
Properties
- $annotations : ToolAnnotations|null
- $description : string|null
- $icons : array<string|int, mixed>|null
- $inputSchema : array<string|int, mixed>
- $meta : array<string|int, mixed>|null
- $name : string
Methods
- __construct() : mixed
- fromArray() : self
-
jsonSerialize()
: Icon[], _meta?: array
}
Properties
$annotations read-only
public
ToolAnnotations|null
$annotations
$description read-only
public
string|null
$description
$icons read-only
public
array<string|int, mixed>|null
$icons
= null
$inputSchema read-only
public
array<string|int, mixed>
$inputSchema
$meta read-only
public
array<string|int, mixed>|null
$meta
= null
$name read-only
public
string
$name
Methods
__construct()
public
__construct(string $name, ToolInputSchema $inputSchema, string|null $description, ToolAnnotations|null $annotations[, array<string|int, Icon>|null $icons = null ][, array<string, mixed>|null $meta = null ]) : mixed
Parameters
- $name : string
-
the name of the tool
- $inputSchema : ToolInputSchema
-
a JSON Schema object (as a PHP array) defining the expected 'arguments' for the tool
- $description : string|null
-
A human-readable description of the tool. This can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a "hint" to the model.
- $annotations : ToolAnnotations|null
-
optional additional tool information
- $icons : array<string|int, Icon>|null = null
-
optional icons representing the tool
- $meta : array<string, mixed>|null = null
-
Optional metadata
fromArray()
public
static fromArray(ToolData $data) : self
Parameters
- $data : ToolData
Return values
selfjsonSerialize()
public
jsonSerialize() : Icon[], _meta?: array}