Tools & retrieval
What is Function Calling?
Function calling is a vendor name for tool calling with a JSON schema.
The model fills arguments that match a declared function. The application runs the function and returns the output to the model.
Why it matters
Function calling is the API-level mechanism that makes tool calling work. When you declare functions with JSON schemas, the model can generate structured arguments that your code can parse and execute without string manipulation.
This is more reliable than asking the model to output JSON in freeform text, because the API enforces the schema at the token-generation level.
Schema design
A function schema declares the function name, a description, and the parameter types. Good schemas use specific types (enums instead of strings, required fields instead of optional), because tighter constraints produce more reliable outputs.
The description matters as much as the schema — the model uses it to decide when to call the function.
Key takeaways
- 1Function calling = tool calling with a JSON schema enforced by the API.
- 2Tighter schemas produce more reliable function calls.
- 3Descriptions guide the model's decision about when to call each function.
Common mistakes
- ✕Using string types when enums would be more precise.
- ✕Writing function descriptions that overlap, confusing the model about which to call.
Related terms
Concept neighborhood
Terms linked from Function Calling in the glossary graph.
- Function Calling
- Tool Calling