Skip to content

Tool Definition Generator

A function signature in, a tool definition out in OpenAI, Anthropic and Gemini form at once, with the token cost of the definition shown.

Parameters
4

1 required. The definition below is sent on every request that offers this tool, whether or not the model calls it.

Tool name
search_orders
Required parameters
1
Optional parameters
3
OpenAI form, characters
1,073
Estimated tokens (OpenAI form)
≈ 268
What this assumes: the three dialects differ in wrapper and in what they will accept, not in the JSON Schema inside them — so the properties block is generated once and wrapped three ways. Anthropic's form has no strict flag, so the strict toggle only changes the OpenAI output and the nullability it implies. A parameter with a default is treated as optional. Everything on this page runs in your browser. Nothing you paste is uploaded, logged or sent anywhere.

The schema is the easy half. The half that decides whether tool calling works is the prose: the function description tells the model when to reach for this tool rather than another, and each parameter description tells it what to put in the field. A tool with a perfect schema and an empty description gets called at the wrong moment with plausible-looking arguments, and that failure looks like a model problem when it is a writing problem.

Why the token count is shown

Tool definitions are part of the prompt. Every definition you offer is serialised into the request on every call, so ten verbose tools can cost more per request than the user's actual message — and they are billed at the input rate on every turn of a conversation, not once. The estimate above is characters ÷ your divisor, so treat it as an order of magnitude rather than a figure; the point is to notice when a schema has grown to a thousand characters of enum values.

Strict mode is not free

Strict structured output guarantees the arguments match your schema, which removes a whole class of parse failure. It also removes genuinely optional parameters: everything must be required, so an optional field becomes a required nullable one and your handler now has to treat null and absent as the same thing. That is usually worth it. It is worth it knowingly.

Tool Definition Generator · Multigrid