Tool Use
Tool use (also called tool calling) is the capability of a large language model to invoke external functions, APIs, or system commands as part of generating a response. Instead of being limited to producing text, a model with tool use can read files, run code, query databases, and interact with services—making it the foundation of agentic AI systems.
How tool use works
When an LLM supports tool use, it receives a list of available tools (functions) with descriptions of what each one does and what parameters it accepts. During a conversation, the model can decide to call a tool instead of (or in addition to) generating text. The tool executes externally, returns a result, and the model incorporates that result into its response. This creates a loop where the model can plan actions, execute them, observe results, and iterate.
Tool use in coding agents
Tool use is what transforms an LLM from a chatbot into a coding agent. Claude Code gives the model tools like Read (read a file), Edit (modify a file), Bash (run a terminal command), and others. When you ask Claude Code to fix a bug, the model calls Read to examine the relevant files, reasons about the issue, calls Edit to fix it, then calls Bash to run tests and verify the fix. Without tool use, it could only describe what to do—with tools, it can actually do it.
// How tool use looks under the hood (simplified)
// The model receives available tools:
const tools = [
{
name: "read_file",
description: "Read the contents of a file",
parameters: { path: { type: "string" } }
},
{
name: "run_command",
description: "Execute a shell command",
parameters: { command: { type: "string" } }
}
];
// Model decides to call a tool:
// { tool: "read_file", args: { path: "src/auth.ts" } }
// System executes the tool, returns result to model
// Model reasons about the result and may call more toolsTool use is what makes the difference between AI that tells you what to do and AI that does it for you. Every coding agent—Claude Code, Codex CLI, Gemini CLI—is built on top of tool use capabilities.
What is the difference between tool use and function calling?+
Can any LLM use tools?+
Is tool use safe?+
Related comparisons
Master Claude Code in days, not months
37 hands-on lessons from beginner to CI/CD automation. Module 1 is free.
START FREE →