Overview
This page is the atomic definition. The implementation guide lives at structured-output.
Definition
Function calling is the OpenAI-coined term for tool-use: the model emits a structured invocation request instead of prose when it determines a function call is needed. The developer provides a list of function schemas (JSON Schema-described name, description, and parameter types) alongside the messages. When the model chooses to call a function, the API returns a response with finish_reason: "function_call" (v1 API) or finish_reason: "tool_calls" (v2). The application executes the function and returns the result as a follow-up message. The pattern generalizes across providers: Anthropic calls it tool use with tool_use content blocks; Google calls it function calling with FunctionCall parts; OpenAI updated its term to tool calls in the Assistants API. All share the same loop: model requests, app executes, model resumes. Parallel function calls (multiple functions in one turn) are supported by all major providers since 2024.
When it applies
Use function calling for structured data extraction, API orchestration, multi-step agentic tasks, and any case where the model must invoke code rather than approximate the output in prose. Define schemas precisely; vague descriptions cause the model to call the wrong function or omit required parameters.
Example
tools = [{
"type": "function",
"function": {
"name": "lookup_order",
"description": "Look up an order by ID and return its status.",
"parameters": {
"type": "object",
"properties": {"order_id": {"type": "string"}},
"required": ["order_id"]
}
}
}]Related concepts
- tool-use - the Anthropic term for the same pattern.
- structured-output - implementation patterns for multi-step tool loops.
- mcp - an open protocol that standardizes function discovery across models.
- structured-output - function arguments are structured JSON schemas.
Citing this term
See Function calling (llmbestpractices.com/glossary/function-calling).