AI Function Calling Schema
Generate strict JSON schemas for OpenAI Function Calling, Structured Outputs, and Anthropic Claude Tools.
Runs in your browser. Nothing you add is uploaded.
What the AI Function Calling Schema does
Describe a tool your AI model can call (its name, what it does, and each parameter's name, type, description, whether it is required and any allowed values) and this builder writes the definition three ways: for OpenAI function calling, for Anthropic tool use (input_schema), and as a matching TypeScript interface for your handler code. With Strict on, it follows OpenAI's Structured Outputs rules: every property is listed as required, optional ones become nullable, additionalProperties is false, and arrays and objects get the fields strict mode insists on.
How to build a function-calling schema
- Start from a template (Get Weather, Query Database, Send Email), or enter your own tool name in snake_case and a one-sentence description.
- Add parameters with a name, type (string, number, boolean, array or object), description and whether each is required.
- For a fixed set of choices, enter enum values separated by commas, for example celsius, fahrenheit.
- Switch Strict on or off depending on whether you use OpenAI Structured Outputs.
- Switch between the OpenAI, Anthropic and TypeScript tabs to copy or download each version.
The AI Function Calling Schema runs entirely in your browser — nothing you enter is uploaded, stored, or logged.
When to use it
One definition for several providers
OpenAI wraps the schema in a function object under parameters, while Anthropic expects name, description and input_schema at the top level. The JSON Schema inside is the same, so defining the parameters once and copying both versions stops them drifting apart when a parameter changes.
Reliable arguments with Structured Outputs
With strict: true, OpenAI constrains generation to your schema, so arguments always parse and always contain every field. The catch is that the schema must follow strict-mode rules (all fields required, no extra properties, nullable types for optional fields), and the builder applies them for you.
Typing the handler
The TypeScript interface matches the schema field for field, including union types for enums and | null for optional fields in strict mode, so the function that receives the model's arguments is typed instead of taking any.
Good to know
- The description is the model's only guide to when to call the tool and what to put in each field. Write it like an instruction: 'City name, e.g. Paris. Not a country.'
- Enums are the most reliable way to restrict a value. For numeric choices, set the type to number so the values are emitted as numbers.
- In strict mode an optional field arrives as null when the model has nothing for it, so handle null in your code.
- Array parameters are generated as arrays of strings and object parameters as empty objects; edit the JSON if you need another item type or nested fields.
- Validate arguments on your server before acting on them, even with a strict schema; the model still chooses the values.
Frequently asked questions
What are OpenAI Structured Outputs?
How do Anthropic Claude Tool definitions differ from OpenAI?
What does 'additionalProperties: false' mean in JSON Schema?
How do tools differ from standard JSON mode?
Page last updated . Found a wrong result or a mistake on this page? Let us know.
Related tools
AI Code & Formula Explainer
Plain-English explanations of formulas, calculations and code.
Optional cloud mode
AI Text Rewriter
Rewrite text in a professional, friendly, concise or formal tone.
Optional cloud mode