Tool Use / Function Calling
Enabling an AI to call external functions or APIs to perform tasks beyond text generation.
Tool use (function calling) lets AI models request external tools rather than only generating text. Supported tools might include: - Web search - Calculator - Database queries - Code execution - Email sending - Weather APIs
The workflow: 1. User asks a question. 2. Model decides which tool to call. 3. System calls the tool and returns results. 4. Model incorporates results and generates a response.
Tool use makes AI more capable—without it, GPT can't check live stock prices or run code. With it, it can. Most modern APIs (OpenAI, Anthropic, Google) support structured tool calling with JSON schemas defining tool inputs and outputs.
Tool use is central to agentic workflows but requires careful safety guards—an unrestricted model could call dangerous tools.
Alt names: "function calling" (OpenAI's term), "tool calling", "tool use".
Example
User: "What's the weather in NYC?" Model calls weather_api("NYC"), gets "72F sunny", and responds "It's 72 degrees and sunny."