Readonly[ReadonlyapihubThe toolset description, filled in from the spec when empty.
ReadonlylazyThe 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 the tool with the given name, or undefined when the spec
produced no such tool.
Unlike OpenAPIToolset.getTool, the result is a Promise, because the spec
may still be loading.
The tool name, which is the operation ID in snake_case.
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.
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 RestApiTool for 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
getToolsorgetTool, and every later call reports the same failure.With
lazyLoadSpec, the spec is fetched on the first call togetToolsorgetTool. A successful result is kept, including a spec that produced no tools. A failed fetch is not kept, so the next call fetches again.