OpenAPI → Agent Tool Converter
Paste an OpenAPI 3.x spec and emit OpenAI-style function definitions and Anthropic-style tool arrays, fully client-side.
Generated Tool Definitions
No conversion yet.OpenAI Functions Array
Press Convert to generate the OpenAI functions array.
Anthropic Tools Array
Press Convert to generate the Anthropic tools array.
OpenAI expects
{"type":"function","function":{"name","description","parameters"}}; Anthropic expects
{"name","description","input_schema"}. Every GET/POST/PUT/PATCH/DELETE operation in the spec becomes
one tool entry.
Professional Insights & Guide
Learn how the converter maps OpenAPI operations into tool schemas, what it handles, and where it draws the line.
Core Use Case scenario
Agent developers wrap existing REST APIs as callable tools. The converter walks the spec's paths object, extracts every HTTP operation, and builds a JSON Schema for its arguments: path and query parameters become string/number properties, and a JSON request body is merged into the object's properties with its required fields preserved. The operationId becomes the tool name, the summary becomes the description, and each provider's wrapper format is emitted separately so the same API works with both OpenAI and Anthropic clients.
What Gets Converted
- HTTP methods: GET, POST, PUT, PATCH, DELETE (and OPTIONS/HEAD when present) under every path.
-
Path parameters like
{city}and query parameters such asunits. -
JSON request bodies whose content type is
application/json. -
Local
$refpointers into#/components/schemas/…and#/components/parameters/…. - required arrays, enums, defaults, and nested object/array schemas inside properties.
Troubleshooting & Edge-Case Failure Points
- Invalid JSON: the parser reports the exact error and nothing is emitted until the spec parses cleanly.
- Missing paths object: the tool stops with a clear message; a spec without operations yields no tools.
- Missing operationId: a readable fallback name is generated from the method and path so the output is still usable.
- Missing requestBody schema: a generic body object is created so the POST still becomes a callable tool.
- Non-object request bodies: the body is wrapped under a "body" property instead of being merged.
Detailed Step-by-Step Instructions
- Paste a valid OpenAPI 3.x JSON document into the spec area, or keep the bundled Tiny Weather API sample.
- Press Convert to Tool Definitions; invalid input shows an inline error instead of output.
-
Review the OpenAI Functions Array, where each operation
becomes a
{"type":"function"}object. -
Review the Anthropic Tools Array, where each operation becomes
a
{"name","description","input_schema"}object. - Copy the JSON you need and paste it directly into your agent's tools or functions parameter.
- Press Reset Sample Spec to restore the demo whenever you want a fresh comparison.
Related Web Utilities (Silo Hub)
Informative Guides & Helper Articles
How to Use the OpenAPI to Tool Schema Converter
Converts REST API specs into LLM function-calling tool definitions - the bridge between your API and your agent.
- Paste your OpenAPI spec (JSON or YAML).
- Select which paths/operations to expose as tools.
- Export tool definitions with parameter schemas.
Paths, Operations, Tool Schemas
The mapping: each operation becomes a tool; path/query parameters become arguments; the requestBody schema becomes the payload parameter; and - the skipped step - descriptions migrate verbatim, because the LLM reads them as documentation. Curation is the real work: 40 tools degrade routing (choice paralysis is real for models); production teams expose 5-15 covering the actual task graph, and bind auth server-side rather than asking the model for tokens. Parameter names become the model vocabulary - rename internal ugliness before converting.
OpenAPI to Tool Schema Converter FAQ
How many tools should I expose?
5-15 focused tools. Dumping a whole API degrades selection - curate to the task graph.
Do API descriptions matter for function calling?
They are the model only manual. Clear parameter descriptions convert directly into correct calls; missing ones become hallucinated arguments.
Authentication parameters?
Keep them out of the schema - bind tokens server-side. Asking the model for auth invites leaks.