What is tool calling in LLMs? Function calling explained
Also called function calling, tool use
Definition
Tool calling is an LLM capability in which the model, given a list of tool definitions, outputs a structured request naming a tool and its arguments, which the application executes and returns.
Tool calling is the mechanism that lets a large language model act on systems outside its weights: search an index, query a database, or send an email. The developer describes each tool with a name, a description, and a JSON Schema for its parameters. The model never runs the tool itself; it emits a structured call, and the application runs it. OpenAI introduced the feature as function calling on June 13, 2023, and the major model APIs now support an equivalent.
How tool calling works#
Tool calling is a loop between the application and the model:
On the Anthropic API, for example, a response that requests a tool ends with stop_reason: "tool_use" and contains a tool_use block; the application sends the tool's output back in a tool_result block (Anthropic tool use docs). An AI agent is this loop repeated until the task is complete. Setting strict: true on a tool definition, supported by both OpenAI and Anthropic, constrains the arguments to the schema using the same technique as structured outputs.
Tool calling vs function calling#
The two terms describe the same capability. OpenAI's original 2023 API used a functions parameter, later deprecated in favor of a more general tools parameter. Anthropic calls the feature tool use and lists function calling as another name for it. "Tool calling" has become the common vendor-neutral term.
Tool calling vs MCP#
The Model Context Protocol does not replace tool calling; it standardizes where tools come from. An MCP server publishes tool definitions that any MCP client can list and invoke, while the model still uses its native tool-calling format to request them. Tool calling is the model-level capability, and MCP is the integration protocol built on top of it.
Because tool results flow back into the prompt, every connected tool is also a path for prompt injection. Give tools the narrowest permissions that work, and require confirmation for actions that are hard to undo. The tool calling explainer goes further into the request and response cycle.
Related terms
Guides that cover tool calling
- What is tool calling? How LLM function calling works
- What is the Model Context Protocol (MCP)? How it works
- What are AI agents? How agents work and when to use one
- Agentic workflows: five patterns and when to use each
- Semantic caching for LLMs: how it works and when it pays off
- How to build an MCP server: a Python and TypeScript tutorial
- How to build an AI agent: a step-by-step guide in Python
- AI coding agents: how they work and how the major tools compare
- vLLM vs Ollama vs llama.cpp vs SGLang: which engine to use
- AI agent frameworks compared: LangGraph, CrewAI, ADK, and more
- AI agent evaluation: metrics, graders, and how to test agents
- Reasoning models: how they work and when to use them
- LLM evaluation: a practical guide to evals, metrics, and judges
- What is retrieval-augmented generation (RAG)? How RAG works
- What is AI engineering? The discipline, the stack, and the work
Cite this definition
The AI Engineering Editors. "What is tool calling in LLMs? Function calling explained." The AI Engineering, updated Nov 06, 2026. https://theaiengineering.com/glossary/tool-calling
- Title
- What is tool calling in LLMs? Function calling explained
- Author
- The AI Engineering Editors
- Publisher
- The AI Engineering
- Updated