Function Calling Schema Generator

Attaching a tool to a model means writing its parameters as JSON Schema, and writing that by hand tends to drop a required entry or leave the type off a nested object. Those mistakes only surface once the model passes the wrong arguments. Give an example of the arguments you want and the schema is derived from it.

{
  "name": "get_weather",
  "description": "Get the weather for a city",
  "input_schema": {
    "type": "object",
    "properties": {
      "city": {
        "type": "string",
        "description": ""
      },
      "days": {
        "type": "integer",
        "description": ""
      },
      "unit": {
        "type": "string",
        "description": ""
      }
    },
    "required": [
      "city",
      "days",
      "unit"
    ],
    "description": ""
  }
}

Everything present in the sample is marked required — removing entries is easier than adding them. Descriptions are left blank for you to fill in, and optional arguments missing from the sample will not be picked up.

The example JSON is the skeleton

The outermost value must be an object wrapped in braces — an array or a single value is refused. Each key becomes a property and the shape of its value becomes the type: a number without a fractional part is integer and one with it is number. A nested object is descended into and gets its own required; an array takes the shape of its first element as items. null becomes ["null", "string"].

What the three tabs produce

Anthropic is name, description and input_schema; OpenAI puts name, description and parameters inside function under type: "function". "Schema only" is the bare JSON Schema. An empty name field becomes my_tool, and the sentence in the description field goes into all three tabs identically.

The limits of guessing from a sample

All a sample reveals is names and types. "unit": "celsius" does not become an enum, and no range or format is attached. A mixed array is judged by its first element only, and an empty array is left as string.

Parsed in the browser

The JSON is read with JSON.parse, so a trailing comma or a comment shows the parser's own message verbatim. The example goes to no server.

Frequently asked questions

Why do OpenAI and Anthropic differ?

Only the wrapper differs. OpenAI nests the definition under type and function and names the field parameters; Anthropic uses one less layer and calls it input_schema. The JSON Schema inside is identical, so both are produced together.

Why is description left empty?

Because a person has to write it. That sentence is what the model uses to decide when to call the tool, so an empty one leaves the tool unused. Generating it automatically would produce something plausible and wrong, which is worse.

How are optional arguments handled?

Everything present in the example starts out as required, because removing an entry is easier than noticing a missing one. Arguments absent from the example are not detected at all, so add those by hand.

I entered 3.0 and got integer

JSON does not distinguish integers from floats, so 3.0 becomes 3 the moment it is read. To get number, write a non-zero fraction such as 3.5.

How do I write an argument whose value I do not know yet?

Use a value of the right shape at least. An empty array yields items of type string, so for a numeric array put in [1] so that items becomes integer.

Does anything I paste get sent to a server?

No. Everything runs inside your browser and nothing is uploaded or stored. That is why you can use it on things you would not normally paste into a web page, like an internal config file or a production query. It also works with your network disconnected.