Readonly[Optional ReadonlyprefixReadonlytoolCloses the toolset.
NOTE: This method is invoked, for example, at the end of an agent server's lifecycle or when the toolset is no longer needed. Implementations should ensure that any open connections, files, or other managed resources are properly released to prevent leaks.
A Promise that resolves when the toolset is closed.
Returns the parsed tool with the given name, or undefined when the spec
produced no such tool.
The lookup is over every tool parsed from the spec and does not apply
toolFilter, which selects what an agent exposes to the model rather than
what the toolset holds. When the toolset was constructed with prefix,
pass the prefixed name.
Returns the tools that should be exposed to LLM.
Optionalcontext: ReadonlyContextContext used to filter tools available to the agent. If not defined, all tools in the toolset are returned.
A Promise that resolves to the list of tools.
ProtectedisReturns whether the tool should be exposed to LLM.
The tool to check.
Context used to filter tools available to the agent.
Whether the tool should be exposed to LLM.
Processes the outgoing LLM request for this toolset. This method will be called before each tool processes the llm request.
Use cases:
The context of the tool.
The outgoing LLM request, mutable this method.
Base class for toolset.
A toolset is a collection of tools that can be used by an agent.