JSON Schema Generator
Define a function once and get the tool schema each provider expects. The parameter object is shared JSON Schema Draft-07; the wrapper around it is not.
Parameters
{
"type": "function",
"function": {
"name": "get_weather_data",
"description": "Retrieves the current weather for a specific location.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
},
"unit": {
"type": "string",
"description": "Temperature unit",
"enum": [
"celsius",
"fahrenheit"
]
},
"num_days": {
"type": "integer",
"description": "Forecast depth in days"
}
},
"required": [
"location"
]
}
}
}OpenAI wraps the definition in { type: "function", function: … }.
Frequently asked questions
What does the JSON Schema Generator produce?
You define a function once, with a name, a description and its parameters, and the tool outputs the tool-calling schema for OpenAI, Anthropic and Gemini. The three share a JSON Schema Draft-07 parameters object but wrap it differently: OpenAI uses a function object of type function with parameters, Anthropic uses input_schema, and Gemini uses functionDeclarations.
What parameter types can I define?
String, number, integer, boolean and array. String parameters can have a list of allowed values, which becomes an enum. Arrays are generated as arrays of strings. Each parameter can be marked required, and the required list is left out entirely when nothing is required.
Does the tool check my definition?
It checks the function name and parameter names before you copy the result, and flags duplicate parameter names and names that are not valid identifiers. Providers can support only a subset of JSON Schema keywords, so test the generated schema against the provider you use.
Does it run my function or call a model?
No. It only generates JSON in your browser, with no API calls and no keys. You paste the output into your own code or SDK call, and your application is responsible for actually running the function.