OpenAPI to Tool Schemas
Convert OpenAPI or Swagger into Zod, JSON Schema, OpenAI function tools, and Anthropic input schemas. Free, no signup.
Privacy: Your OpenAPI file never leaves this browser. Conversion is 100% client-side.
1. Paste or upload OpenAPI
How to Use
- 1Paste OpenAPI JSON/YAML or upload a spec (or load the sample).
- 2Select the operations you want as agent tools.
- 3Pick Zod, JSON Schema, OpenAI, and/or Anthropic outputs.
- 4Generate, copy into your app, or download the ZIP. Validate with MCP Tool Checker if needed.
Example outputs
Zod
export const ListPetsInputSchema = z.object({ limit: z.number().int().optional() })TypeScript validators with inferred types.
OpenAI tools
{ "type": "function", "function": { "name": "list_pets", "parameters": { ... } } }Drop into Chat Completions tools arrays.
Anthropic tools
{ "name": "list_pets", "input_schema": { "type": "object", ... } }Messages API tool definitions with input_schema.
Schema tips for reliable tool calling
- •Add operationId and clear summaries so tool names and descriptions stay stable.
- •Prefer enums and required fields over optional free-form strings.
- •Exclude admin/DELETE routes unless the agent should mutate production data.
- •Use Zod in TypeScript apps; use OpenAI/Anthropic JSON for hosted LLM APIs.
- •Need a Cursor MCP process? Use OpenAPI to MCP after you like these schemas.
Frequently Asked Questions
What does OpenAPI to Tool Schemas produce?
It turns OpenAPI/Swagger operations into agent-ready input schemas: Zod TypeScript, JSON Schema, OpenAI function tools, and Anthropic tools with input_schema — without generating a full MCP server process.
How is this different from OpenAPI to MCP?
OpenAPI to MCP builds a runnable MCP server package for Cursor/Claude Desktop. This tool emits portable schema files for function calling, validation, and custom agent runtimes. Use both: schemas for apps, MCP for IDE agents.
Which OpenAPI versions are supported?
OpenAPI 3.0/3.1 (JSON or YAML) work best. Swagger 2.0 is best-effort. Local #/ $refs are resolved in-browser; remote $refs are not fetched.
Does my OpenAPI leave the browser?
No. Parsing and codegen run entirely client-side. Instant Tools never uploads your specification for this tool.
Can I use the OpenAI tools JSON with the Responses API?
The openai-tools.json file follows the Chat Completions tools shape ({ type: "function", function: { name, description, parameters } }). Adapt field names if your SDK expects the newer flat function tool format.
Is this converter free?
Yes. No signup, no usage limits, and you own the generated schemas.
Related Tools
JSON to Schema
Infer Zod from example JSON payloads
OpenAPI to MCP
Generate a full Cursor-ready MCP server
MCP Tool Checker
Score tool schemas for agent readiness
llms.txt Generator
AI crawler index file for your site
Cursor Rules Generator
Generate .mdc, AGENTS.md, and CLAUDE.md
Prompt & Rules Linter
Score system prompts and agent rules for clarity