Overview
Function calling (also called tool use) lets a model translate an intent into a structured call against an API you define. The model does not execute anything itself; it returns a name and validated arguments, and your code decides whether to run it.
How it works
You supply a schema for each available function. The model decides whether a call is needed, which function fits, and emits JSON arguments matching the schema. Your application executes it and returns the result, which the model uses to compose its reply.
Use cases
In-app assistants
Let users say what they want and have the app perform it through existing endpoints.
SaaSData lookups
Fetch live order, account or inventory data mid-conversation.
E-commerceStructured extraction
Force output into a strict schema for reliable downstream processing.
DataMulti-system actions
Chain calls across CRM, billing and messaging from one instruction.
OperationsBenefits
- Turns natural language into reliable, typed API calls.
- Keeps execution and authorisation on your side of the boundary.
- Makes assistants genuinely useful rather than conversational only.
- Schema validation catches malformed calls before they run.
Limitations
- Models sometimes pick the wrong tool or invent parameter values.
- Too many available functions degrades selection accuracy.
- Every exposed function widens your security surface.
- Schemas and descriptions need real maintenance as APIs evolve.
What to look for when choosing a tool
- Strict JSON-schema validation on arguments
- Parallel and sequential call support
- Confirmation flow for irreversible actions
- Per-function authorisation on your side
- Observability into which tools get called and why