← AI Terminology
Function Calling
Function calling is a model capability and API pattern where the LLM emits structured calls to named tools (functions) with typed arguments, which the host executes and returns as observations.
It is the mainstream product interface for tool use in OpenAI, Anthropic, Google, and open-model stacks.
It is the mainstream product interface for tool use in OpenAI, Anthropic, Google, and open-model stacks.
Why It Matters in AI
Free-form tool text is brittle; function calling standardises names, JSON schemas, and multi-step tool loops. Nearly every production agent — booking, code exec, retrieval — is built on this contract.
Key Points
| Aspect | Description |
|---|---|
| Loop | Model → tool call → execute → tool result → model |
| Risk | Hallucinated args; need validation and authz |
| Related | Tool use, ReAct, MCP tool surfaces |
| Training | Special finetunes teach schema adherence |
| API shape | Tools listed with JSON Schema; model returns tool_calls |
| Parallel calls | Many APIs allow multiple tools in one turn |
Simple Analogy
Ordering from a restaurant with a fixed menu form — dish name and options in the right fields — instead of free-form shouting into the kitchen.
Common Usage Examples
- OpenAI
tools=[...]+tool_callsin responses - Anthropic tool use blocks
- Gemini function declarations
- Validate args with Pydantic before execution
Summary
In short: Function calling is the structured API where models request named tools with schema-valid arguments — the backbone of production agents.