ModelRefs / Tool Definition — AI Glossary

Tool Definition — AI Glossary

The formal specification of a callable function provided to the LLM in an API request, enabling structured tool use. Anthropic uses a similar structure.

Overview

Tool definitions in OpenAI format: an object with type='function', function.name, function.description (natural language—critical for selection), and function.parameters (JSON Schema). Anthropic uses a similar structure. The model emits tool_call objects referencing tool names with arguments when it decides to use a tool.

Reference details

Topicecosystem
Also known asfunction definition, tool spec
Last reviewed2026-06-24

How it works

  1. The definition is a name, a description and a JSON Schema for the arguments, and all three are serialised into the request as text the model reads.
  2. Support for the schema vocabulary is uneven: enumerations and required fields are honoured reliably, while unions, string patterns and deeply nested arrays degrade into suggestions the model may ignore.
  3. That unevenness means a constraint expressed in a weakly supported construct still has to be validated after the fact, so the schema is a hint to the model and a contract for your validator.
  4. Per-parameter descriptions are read and used, which matters because a type alone does not convey meaning — a string field named `region` needs its permitted form stated somewhere the model can see.
  5. Enumerations are the strongest available constraint precisely because they remove the generation problem: the model selects from supplied values rather than composing one.
  6. Where the provider supports constrained decoding against the schema, the arguments are guaranteed to parse — which removes malformed calls from the failure list and leaves wrong ones untouched.

Example: The description is prompt text, and it is not free

A tool definition is a name, a natural-language description and a JSON Schema for the parameters — and all of it is serialised into the request. Twenty tools averaging 80 tokens each is 1,600 tokens of context spent before the user's question is read, on every call. The description is also the only thing the model has when deciding which tool to reach for: two tools whose descriptions do not clearly separate their cases will be confused with each other no matter how good the model is. Selection accuracy is a writing problem before it is a model problem.

Commonly confused with

The definition is the contract sent in the request; the tool call is what the model emits against it; the execution is what your code does with that. The model never runs anything — it produces a structured request, and every permission and validation decision belongs on your side of that boundary.

When to use it

Reach for it when:

  • Any tool-calling integration — the schema is what makes the call parseable
  • Constraining inputs with enums and required fields, so invalid calls fail at the schema
  • Rewriting descriptions as a first fix when the model picks the wrong tool

Reach for something else when:

  • Attaching every available tool to every request — it costs context and hurts selection
  • Trusting arguments without validation: a schema-valid call can still be a wrong or hostile one
  • Overlapping tools with near-identical descriptions, which guarantees confusion

Continue your research

Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to Tool Definition — AI Glossary.

Frequently asked questions

What is Tool Definition?

The formal specification of a callable function provided to the LLM in an API request, enabling structured tool use.

Is Tool Definition the same as function definition?

Yes — function definition, tool spec are common aliases for Tool Definition.

What concepts are related to Tool Definition?

Closely related concepts include tool schema, tool use, tool selection.