Readonly[The toolset description, filled in from the spec when empty.
The toolset name, filled in from the spec when empty.
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 one tool per operation in the spec, or an empty array when the spec is empty.
Optionalcontext: ReadonlyContextProtectedisReturns whether the tool should be exposed to LLM.
The tool to check.
Optionalcontext: ReadonlyContext
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.
Builds one tool per operation of an API registered in API Hub.
The toolset fetches an OpenAPI spec from API Hub, parses it as YAML or JSON, and hands it to an OpenAPIToolset, which produces a
RestApiToolfor each operation.By default the spec is fetched when the toolset is constructed. A constructor cannot wait for the request, so a failure is reported by the first call to
getTools, and every later call reports the same failure.With
lazyLoadSpec, the spec is fetched on the first call togetTools. A successful result is kept, including a spec that produced no tools. A failed fetch is not kept, so the next call fetches again.