Sign in
Capabilities

Tool Use

How LLMs interact with external systems to extend their capabilities

What it is

Tool use (also called function calling) is the ability of an LLM to invoke external code or APIs during a conversation. The model is given descriptions of available tools in its system prompt. When it determines a tool should be used, it outputs a structured call, execution is handed off to the calling code, and the result is returned to the model as context before it continues generating.

Common tools include: web search, code execution, database queries, file operations, calendar access, and custom APIs. The model doesn't run code itself, it decides what to call and interprets results.

This architecture is how Claude Code, ChatGPT's code interpreter, and virtually every AI product with external integrations work.

Why it matters

Tool use is what transforms LLMs from impressive text generators into systems that can actually do things in the world. Almost every AI product worth building involves tool use. Understanding how it works (the model generates structured calls, code executes them, results feed back) helps you architect AI systems correctly, understand failure modes (what if the tool fails?), and explain agent behavior to clients.

Related concepts

Resources

Deep Dive into LLMs like ChatGPT (section: tool use ~1:20:00
youtube.com· Explains how LLMs use special tokens to invoke external tools (calculators, web search, code execution). Shows the actual format of tool-calling messages in the conversation structure.
20 min
What Is Function Calling in AI?
youtube.com· Concise lightboard explanation of how LLMs decide when to call tools, generate structured JSON parameters, and integrate results back into responses.
8 min
Function Calling in AI Agents
promptingguide.ai· Thorough walkthrough of the mechanics: tool definitions, the agent loop (action → observation → decision), concrete examples with weather APIs and search. Excellent reference.
12 min
Functions, Tools and Agents with LangChain (Lesson 1: OpenAI Function Calling)
deeplearning.ai· Andrew Ng + Harrison Chase (LangChain CEO) walking through function calling with actual code. Hands-on if recruits want to see it in action. Free access.
15 min
PreviousBeginning of section
NextAgentic Capabilities