execute(args) that performs the HTTP call. Drop the result straight into an
agent’s tools.
Each operation’s summary / description becomes the tool description, so the
agent already knows what each call does.
The async factories (
createOpenApiTools, createOpenApiTool) fetch URL specs.
The *Sync variants take only an object or a local file path; they do not fetch
URLs. Pick async when the spec lives behind an HTTP URL.createOpenApiTools
Build a record of tools from an entire spec, keyed byoperationId. Async, so it
can load a spec from a URL.
The spec as a parsed object, a file path, an HTTP URL, or raw JSON/YAML text.
Auth, filtering, base URL, and per-operation curation.
A record of AI SDK tools keyed by
operationId (or the curated name).createOpenApiTools.js · OpenApiToolsOptions.ts · Tests tool-factory.test.js · See also OpenAPI tools, Tools
createOpenApiToolsSync
SynchronouscreateOpenApiTools. Accepts only a spec object or a local file
path, never a URL. Use it when you can resolve the spec on disk at build time.
A parsed spec object, a local file path, or raw JSON/YAML text. URLs are not
fetched.
Identical to
createOpenApiTools.A record of AI SDK tools keyed by
operationId.createOpenApiToolsSync.js · Tests tool-factory.test.js · See also OpenAPI tools
createOpenApiTool / createOpenApiToolSync
Build a single tool from one operation, selected byoperationId. Same options
as the bulk factories; the only extra argument is the operationId.
createOpenApiTool is async (fetches URL specs); createOpenApiToolSync is
synchronous and object/file-only.
The spec.
createOpenApiTool accepts a URL; createOpenApiToolSync does not.The
operationId of the operation to turn into a tool.Same shape as
createOpenApiTools. include /
exclude are ignored here since one operation is named directly.A single AI SDK tool.
createOpenApiTool returns a Promise<Tool>.createOpenApiTool.js · createOpenApiToolSync.js · Tests tool-factory.test.js · See also Tools
listOperations
Introspect a spec without building any tools. Returns one entry per operation, useful for auditing what an agent would be able to call before wiring it up.A parsed spec object, a local file path, or raw JSON/YAML text.
One entry per operation.
listOperations.js · Tests spec-parser.test.js · See also OpenAPI tools
Types
OpenApiAuth, OpenApiSpec, and OpenApiToolsOptions are exported from
smithers-orchestrator. Tool is the AI SDK tool type from the ai package.
OpenApiAuth
Applied to every request. A discriminated union ontype.
OpenApiSpec
The parsed OpenAPI 3.x document shape accepted as an objectinput. Most callers
pass a file path or URL string instead and let the loader parse it, but you can
import the type to construct or narrow a spec yourself.
OpenApiSpec,
OpenApiPathItem, and OpenApiSchemaObject shapes.
Source OpenApiAuth.ts · OpenApiSpec.ts · Tests spec-parser.test.js · See also Types, OpenAPI tools
For request/response handling, filtering semantics, observability metrics, and current limitations (cookie params, non-JSON bodies, Swagger 2.0), see the OpenAPI tools concept. For wiring tools into agents, see Tools.