Skip to content
TabBench

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

  1. Start from a template (Get Weather, Query Database, Send Email), or enter your own tool name in snake_case and a one-sentence description.
  2. Add parameters with a name, type (string, number, boolean, array or object), description and whether each is required.
  3. For a fixed set of choices, enter enum values separated by commas, for example celsius, fahrenheit.
  4. Switch Strict on or off depending on whether you use OpenAI Structured Outputs.
  5. 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?

Structured Outputs constrain the model so its arguments always match your JSON Schema. It requires 'strict: true', 'additionalProperties: false' on every object, and every property listed in 'required' (optional ones are made nullable).

How do Anthropic Claude Tool definitions differ from OpenAI?

Anthropic uses an 'input_schema' object at the top level of each tool, whereas OpenAI wraps function definitions inside a 'function' property within a 'type: "function"' array object.

What does 'additionalProperties: false' mean in JSON Schema?

It says no keys other than the declared properties are allowed. OpenAI's strict mode requires it on every object, so the model can never add a field your code does not expect.

How do tools differ from standard JSON mode?

JSON mode only guarantees syntactically valid JSON in the reply. A tool definition tells the model which actions exist and the exact arguments each takes, and the model decides when to call one.

Page last updated . Found a wrong result or a mistake on this page? Let us know.

  • Image to Text (OCR)

    Copy text out of screenshots, scans and photos (OCR).

    Optional cloud mode

  • AI Code & Formula Explainer

    Plain-English explanations of formulas, calculations and code.

    Optional cloud mode

  • AI Text Summarizer

    Condense long text into a short summary or key bullet points.

    Optional cloud mode

  • AI Text Rewriter

    Rewrite text in a professional, friendly, concise or formal tone.

    Optional cloud mode