---
title: "Function calling"
slug: "function-calling"
category: "glossary"
tags: ["glossary", "ai-agents", "llm", "tools", "openai", "agentic"]
status: "stable"
last_updated: 2026-05-14
summary: "Function calling lets a model emit structured requests to invoke developer-defined functions instead of prose, forming the foundation of agentic workflows."
related:
  [
    "[[ai-agents/structured-output]]",
    "[[glossary/tool-use]]",
    "[[glossary/mcp]]",
    "[[glossary/structured-output]]",
    "[[ai-agents/multi-agent]]",
    "[[glossary/system-prompt]]",
  ]
---

## Overview

This page is the atomic definition. The implementation guide lives at [[ai-agents/structured-output]].

## Definition

Function calling is the OpenAI-coined term for [[glossary/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

```python
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

- [[glossary/tool-use]] - the Anthropic term for the same pattern.
- [[ai-agents/structured-output]] - implementation patterns for multi-step tool loops.
- [[glossary/mcp]] - an open protocol that standardizes function discovery across models.
- [[glossary/structured-output]] - function arguments are structured JSON schemas.

## Citing this term

> See [[glossary/function-calling|Function calling]] (llmbestpractices.com/glossary/function-calling).

## Related

- [[glossary/tool-use]]
- [[ai-agents/structured-output]]
- [[glossary/mcp]]
- [[glossary/structured-output]]
- [[ai-agents/multi-agent]]
