CONCEPT

Tool Use / Function Calling

Authoritative Definition

The capability of Large Language Models to generate structured JSON parameters to invoke external functions, APIs, or database queries.

Overview & Technical Description

Tool use, or function calling, transforms passive language models into active agents capable of interacting with external environments. It operates by providing the model with a predefined schema of available tools, detailing their expected inputs, descriptions, and outputs. When the LLM determines that a specific piece of information or action is necessary to fulfill a prompt, it halts text generation and outputs a structured payload (usually JSON) that maps to the tool's signature. This mechanism is the core driver of autonomous agent architectures. By leveraging function calling, models can execute web searches, query internal SQL databases, trigger CI/CD pipelines, or control physical robots. The execution layer—typically handled by an orchestration framework—receives the generated JSON, executes the underlying code, and returns the result to the LLM's context window. The model then synthesizes this raw tool output into a natural language response or decides to chain multiple tool calls together to solve complex, multi-step problems. Fine-tuning specifically for function calling has dramatically improved the reliability and formatting consistency of these outputs. Modern AI infrastructure treats tool schemas as first-class citizens, utilizing protocols like the Model Context Protocol (MCP) to seamlessly expose diverse enterprise APIs to agentic workflows. This paradigm bridges the gap between probabilistic reasoning and deterministic software execution.

Editorial Notes

To prevent hallucinated arguments or infinite loops, production environments must enforce strict JSON schema validation, implement robust error-handling callbacks, and carefully manage the context overhead of exposing too many tools simultaneously.

Related Concepts

Companies Implementing Tool Use / Function Calling

2 listed

Products & Tools