ToolSearch
class ToolSearch
Properties
| protected int | $maxToolCalls | ||
| protected int | $maxOutputBytes | ||
| protected array<int, string|Tool> | $tools |
Methods
Create a searchable tool catalog.
Return the search and execution tools.
Search eligible tools within the output limit.
Encode a tool-search result as response content.
Invoke a catalog tool under its own request context.
Resolve the catalog and reject duplicate names.
Split search text into normalized terms.
Build a failed tool result.
Describe an output-limit failure.
Measure the encoded output size.
Details
at line 36
__construct(iterable $tools)
Create a searchable tool catalog.
at line 57
array
tools()
Return the search and execution tools.
at line 67
array
search(string $query, int $limit)
Search eligible tools within the output limit.
at line 134
array
execute(array $calls, Request $parentRequest)
Execute requested tools and collect their results.
at line 165
Response
response(array $content, bool $isError = false)
Encode a tool-search result as response content.
at line 179
protected array
invokeTool(Collection $tools, string $name, array $arguments, Request $parentRequest, int $index)
Invoke a catalog tool under its own request context.
at line 234
protected Collection
resolvedTools()
Resolve the catalog and reject duplicate names.
at line 254
protected array
terms(string $text)
Split search text into normalized terms.
at line 267
protected array
failedResult(string $message)
Build a failed tool result.
at line 280
protected array
outputLimitExceeded(int $completedToolCalls = 0, int $attemptedToolCalls = 0)
Describe an output-limit failure.
at line 298
protected int
outputSize(array $output)
Measure the encoded output size.