Function-Calling Schema Builder
Build a valid JSON Schema for LLM function calling — name, description, typed parameters, required flags and enums. OpenAI + Anthropic. Free, in-browser.
Function-Calling Schema Builder
Letters, numbers and underscores only — anything else is stripped as you type.
How to Use the Function-Calling Schema Builder
Name the function and describe it
Give the function a clear name (letters, numbers and underscores only) and a description that tells the model exactly when to call it and what it returns. The description is what the LLM reads to decide whether the tool fits the user's request.
Add your parameters
For each input the function takes, add a parameter row: a name, a type (string, number, integer, boolean, array or object), and a short description. Tick "required" for parameters the model must always supply.
Constrain values with enums
Where a parameter only accepts a fixed set of values — units, statuses, categories — list them in the enum field as a comma-separated list. The builder turns them into a string array the model is restricted to.
Pick a format and copy
Switch between "OpenAI tools" and "Anthropic tools" to match your API, then copy the JSON or download a .json file. It all builds in your browser — nothing is sent anywhere.
Function Calling Is How an LLM Reaches the Real World
The schema is the contract between your model and your code
Large language models are brilliant at language and useless at acting on the world by themselves. They cannot read your database, hit an API, send an email, or check the weather. Function calling — also called tool use — closes that gap. You describe the functions your application exposes, the model decides when one is needed, and it returns a structured request naming the function and its arguments. Your code runs the real function and hands the result back. The model never executes anything itself; it only proposes a well-formed call. The piece that makes this reliable is the JSON Schema you give it for each function.
That schema is a contract. It tells the model the function's name, a description of what it does and when to use it, and the shape of its parameters: each parameter's name, its type, what it means, and whether it is mandatory. A good description is doing real work — it is the only signal the model has to decide whether this tool fits the user's request, so vague names like doThing with empty descriptions lead straight to wrong or skipped calls. Spend your effort there. The parameter list does the rest: it constrains the model into producing arguments your code can actually parse, instead of a sentence you have to scrape values out of.
Every parameter has a type drawn from the JSON Schema vocabulary — string, number, integer, boolean, array, or object. Choosing the right one matters: integer stops the model from handing you 3.5 where you expected a whole count, and boolean gives you a true/false you can branch on directly. Each parameter can carry its own description, and the model reads those too — a field called unit described as "temperature unit to return" produces far better calls than a bare unit with no hint.
"The model is only as accurate as your schema is precise. A vague description invites a wrong call; a tight one with the right types and enums all but writes the call for you."
Required versus optional, and why enums are your strongest lever
Not every parameter is mandatory. The required array lists the parameters the model must always provide; everything else is optional, and the model supplies it only when it is relevant. Getting this split right keeps your function flexible without making the model hallucinate values it has no basis for — mark a field required only when your code genuinely cannot run without it, and leave sensible defaults to your own logic. Over-marking parameters as required is a common cause of the model inventing plausible-looking but fabricated arguments.
The sharpest control you have is the enum. When a parameter accepts only a fixed set of values — celsius or fahrenheit, a list of statuses, a set of categories — listing them as an enum restricts the model to exactly those strings. This eliminates an entire class of bugs where the model returns "Centigrade" or "metric" and your switch statement falls through. Enums turn fuzzy natural language into the precise tokens your code already expects, and they make the model's job easier because it is choosing from a menu rather than guessing.
OpenAI and Anthropic wrap the same underlying JSON Schema slightly differently. OpenAI nests it under { "type": "function", "function": { ... "parameters": { ... } } }; Anthropic uses a flatter { "name", "description", "input_schema": { ... } }. The properties, types, required list and enums are identical between them — only the envelope changes. This builder assembles a plain JavaScript object from your inputs and serialises it with JSON.stringify, so the output is always valid, correctly indented JSON in whichever shape you select. Build your schema, switch formats to match your API, copy or download it, and paste it straight into your tools definition. Everything runs locally in your browser, so nothing you design is ever uploaded.
10 Facts About Function Calling
Function calling lets an LLM request a real action — the model proposes the call, your code runs it.
The model never executes anything itself; it only returns a structured name-and-arguments request.
Each function is described with a JSON Schema — the contract that shapes every call.
The description is the highest-leverage field — it's how the model decides whether the tool fits.
Parameter types (string, number, integer, boolean, array, object) keep arguments parseable.
An enum restricts a value to a fixed set — the strongest defence against fuzzy arguments.
The required list names mandatory parameters; over-marking invites fabricated values.
OpenAI nests the schema under function.parameters; Anthropic uses input_schema.
The underlying schema is the same across vendors — only the surrounding envelope differs.
This builder serialises with JSON.stringify in your browser — always valid JSON, never uploaded.
Frequently Asked Questions
- Function calling lets a language model request that your application run a real function — fetch data, call an API, perform an action. You describe the function with a JSON Schema; the model decides when it's needed and returns a structured request naming the function and its arguments. Your code executes it and returns the result. The model never runs anything itself.
- They wrap the same JSON Schema differently. OpenAI nests it under a
functionobject with aparametersfield. Anthropic uses a flatter shape with the schema in aninput_schemafield. The properties, types, required list and enums are identical — only the envelope changes. Use the toggle to match your API. - No. The schema is assembled entirely in your browser with plain JavaScript and serialised with JSON.stringify. Nothing you type is sent to any model, server, or third party, and nothing is saved.
- The standard JSON Schema types:
string,number,integer,boolean,arrayandobject. Choosing precisely matters — useintegerfor whole counts andbooleanfor true/false flags so the model returns values your code can use directly. - Mark a parameter required only when your function genuinely cannot run without it. Everything else stays optional, and the model supplies it only when relevant. Over-marking fields as required is a common cause of the model inventing plausible but fabricated values.
- An enum restricts a parameter to a fixed set of allowed values — for example
celsius, fahrenheit. Enter them as a comma-separated list and the builder turns them into a string array the model must choose from. Enums eliminate a whole class of bugs where the model returns a synonym your code doesn't recognise. - Both OpenAI and Anthropic require function names to match a pattern of letters, numbers and underscores. The builder strips any other character as you type, so the schema you copy is always valid and won't be rejected by the API.
- It's the most important field. The description is the only signal the model has to decide whether the tool fits the user's request and how to fill its arguments. Be specific about what the function does, when to call it, and what it returns — vague descriptions lead to skipped or wrong calls.
- Yes. The output is standard JSON Schema in the OpenAI or Anthropic envelope, which most agent frameworks accept directly or with a thin adapter. Generate the schema here, then drop it into your tools definition wherever your framework expects it.
- Completely free, with no account or sign-up, and no limit on use. It runs entirely in your browser and collects no data.
Related News
You may be interested in these recent stories from our newsroom.
No related news yet for this tool. Our editorial team publishes new pieces every week.
Browse all news →75 more free tools
Calculators, converters, security tools — no signup.