Convert OpenAPI endpoints into LLM tools
The OpenAPI → LLM Tool Schema Converter takes an OpenAPI 3.x specification and produces ready-to-use function-calling tool definitions for OpenAI or Anthropic. Pick exactly the endpoints you want the model to be able to call, and the tool merges their parameters into a single JSON Schema per operation.
How it works
The converter scans paths for every operation (GET, POST, PUT, PATCH, DELETE).
For each, it collects path and query parameters and, when present, the
application/json request-body schema, merging them into one properties object
with a combined required list. Parameter description fields are preserved so
the model understands each argument. The result is emitted in OpenAI’s
{ type: "function", function: {...} } shape or Anthropic’s { name, description, input_schema } shape, depending on your selection.
What the two output formats look like
Given a GET /orders/{orderId} operation with a path parameter and a query
parameter, the converter produces:
OpenAI format:
{
"type": "function",
"function": {
"name": "getOrder",
"description": "Retrieve a specific order by its ID.",
"parameters": {
"type": "object",
"properties": {
"orderId": {
"type": "string",
"description": "The unique identifier of the order."
},
"include_items": {
"type": "boolean",
"description": "Whether to include line items in the response."
}
},
"required": ["orderId"]
}
}
}
Anthropic format:
{
"name": "getOrder",
"description": "Retrieve a specific order by its ID.",
"input_schema": {
"type": "object",
"properties": {
"orderId": { "type": "string", "description": "The unique identifier of the order." },
"include_items": { "type": "boolean", "description": "Whether to include line items." }
},
"required": ["orderId"]
}
}
The only structural differences are the top-level wrapper and the parameters
vs input_schema key name — the inner JSON Schema is identical.
Workflow: from API spec to working agent
- Export your OpenAPI spec from your API framework (FastAPI, NestJS, Django REST, etc.) or download it from your provider.
- Paste it here and let the converter list every available operation.
- Select only what the model needs. An agent that can read orders does not need the delete-account endpoint. Fewer tools = more reliable calling.
- Copy the output array into your function-calling setup or MCP server configuration.
- Improve descriptions. Auto-generated
descriptionfields from most frameworks say things like “Get order.” That is not enough for a model. Rewrite them to explain when to call the tool and what the result is.
Tips and notes
- Expose only the endpoints the model genuinely needs — fewer, well-described tools beat a giant menu.
- Make sure your OpenAPI parameter
descriptionfields are written for a model, not just a human reader. - If an operation lacks an
operationId, give it one in your spec so the generated tool name is stable. - Request body schemas that use
$refreferences need to be resolved (dereferenced) in your spec before pasting. Most API frameworks can export a “bundled” or “dereferenced” version. - Everything runs locally; nothing you paste leaves your browser.