Tool Calling and Function Schemas
Tools let an agent do things a model cannot, like query a database or send an email. The model needs a precise description of each tool, and that description is a function schema.
What a schema contains
- A name the model emits to choose the tool.
- A natural language description explaining when to use it.
- A typed list of parameters, usually as JSON schema, with which fields are required.
How a call works
The model does not run code directly. Instead it outputs a structured request naming a tool and a set of argument values. The runtime validates those arguments against the schema, runs the real function, and returns the output as a new observation. This separation keeps execution under the application's control.
Why good schemas matter
The model picks tools and fills arguments using only the names, descriptions, and types you supply. Vague descriptions cause wrong tool choices, and loose typing causes malformed arguments. Clear, specific schemas with examples reduce these errors dramatically, so schema design is as important as prompt design.
Key idea
A function schema names a tool, describes when to use it, and types its arguments so the model can call it correctly.