Function Calling / Tool Use Schema Generator
Build a function-calling JSON schema once, then copy the exact wire format for OpenAI, Anthropic (Claude) and Google Gemini side by side. Enums, arrays, required fields and OpenAI strict mode handled. No API key, no signup, runs entirely in your browser.
How it works
Function calling (OpenAI), tool use (Anthropic) and function declarations (Gemini) all solve the same problem: telling a model which functions it may call and what arguments each takes. Under the hood, every provider describes those arguments with the same JSON Schema vocabulary. Only the envelope around that schema changes from one SDK to the next — which is exactly the part that is easy to get wrong by hand.
This generator splits the job into two deterministic steps. First it builds the shared schema core from your parameter rows:
{
"type": "object",
"properties": {
"<name>": { "type": "<type>", "description": "<text>" }
},
"required": ["<names where required = true>"]
}A type of enum maps to { "type": "string", "enum": [...] } because an enum is a constraint, not a JSON type. An array becomes { "type": "array", "items": { "type": "<scalar>" } }. An empty required array is omitted entirely, matching how the providers document the zero-required case.
Second, it wraps that core in each provider's documented shape. OpenAI's Chat Completions nests it under function.parameters inside a { "type": "function" } object; Anthropic puts it at the top level under input_schema; Gemini nests it inside function_declarations[]. When you turn on OpenAI strict mode(Structured Outputs), the tool follows OpenAI's three documented rules: it sets strict: true, adds additionalProperties: false, and promotes every property into required, then warns you which optional fields it had to promote.
Generation is referentially transparent: identical inputs always produce byte-identical output. Two checks back the credibility badge — the schema core is compared across all three providers to confirm it is identical, and the final string is round-tripped through JSON.parse so the output is guaranteed to be valid JSON for every input combination.
Worked examples
Frequently asked questions
Sources & references
- OpenAI — Function calling guide & API reference
- Anthropic — Tool use (Claude Messages API)
- Google — Gemini API function calling
- JSON Schema — Draft 2020-12 core specification
Each provider's envelope key names were last cross-checked against the official docs on 2026-06-28. The generator is updated whenever a provider changes its documented format.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a bug, edge case, or want a provider or schema keyword added?
Email me at [email protected] — most fixes ship within 24 hours.