Skip to content

Home / Glossary / Tool Use

Definition

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.

typescript
// 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 tools

Tool 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?+
They are essentially the same concept. "Function calling" is the term OpenAI popularized; "tool use" is the term Anthropic uses. Both refer to the model's ability to invoke external functions with structured parameters during a conversation.
Can any LLM use tools?+
No. Tool use requires specific training and API support. The model must be trained to recognize when a tool is needed, select the right one, and format parameters correctly. Major models like Claude, GPT-4, and Gemini support tool use; many smaller or older models do not.
Is tool use safe?+
Tool use is as safe as the permissions you grant. Claude Code includes a permission system where you control which tools the model can use and what actions require human approval. Always restrict tool access to what is necessary for the task.

Related terms

البرمجة الوكيليةبروتوكول سياق النموذج (MCP)وكيل البرمجةFunction Calling

Related comparisons

Claude Code vs ClineClaude Code vs Gemini CLI

Master Claude Code in days, not months

37 hands-on lessons from beginner to CI/CD automation. Module 1 is free.

START FREE →
← ALL TERMS