Intermediate · Generative AI
Tool Calling
Visual diagram · (in preparation) · Math · (in preparation) · Worked example · 3 difficulty levels.
TL;DR. An LLM capability where the model emits structured calls to external functions or APIs.
Technical Definition
An LLM capability where the model emits structured calls to external functions or APIs.
How it works
Instead of answering directly, the model returns a JSON object naming a tool and its arguments. The host application executes the tool and returns the result, which the model uses to continue. Tool calling turns LLMs into orchestrators of search engines, calculators, databases, and code interpreters.
Related Concepts
- AI Agent — An AI system that autonomously plans, uses tools, and takes actions to accomplish goals through iterative reasoning.
- Autonomous Agents — AI systems that pursue goals over many steps with minimal human intervention.
- Function Calling — Provider-defined schemas that let an LLM invoke developer-supplied functions in a structured way.