Form-built tool definitions → clean tools JSON for LLM APIs.
[
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current weather for a city",
"parameters": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "City name, e.g. \"San Francisco\""
},
"unit": {
"type": "string",
"description": "Temperature unit",
"enum": [
"celsius",
"fahrenheit"
]
}
},
"required": [
"city"
]
}
}
}
]🛠️ Output matches the OpenAI tools array (also accepted by Anthropic tool-use with minor key renames). "integer" maps to JSON Schema integer; enums become string unions the model must respect. Description quality drives calling accuracy more than anything else here.
The tools parameter wants an array of function objects carrying name, description, and a JSON Schema for parameters. Hand-writing the nesting is where most typos live; the form makes it structural.
The model chooses tools and fills arguments mostly from your descriptions. A precise parameter description ("City name, e.g. San Francisco") outperforms any clever schema trick.
Comma-separated enum values become strict choices the model must pick from — the cheapest way to eliminate invalid arguments before they reach your function.
The output targets the OpenAI tools array. Anthropic accepts the same shape with input_schema instead of parameters; most other providers follow one of the two conventions with minimal renames.
More tools you might find useful
Fill {{variables}} in prompt templates from JSON — live preview.
Color-coded token boundaries with counts — see what models see.
Token count vs every model context limit, with headroom percentages.
CSV training rows → OpenAI chat-format JSONL, mapped and validated.