Tool Use (Function Calling)

Tool use is an AI capability where the model can call external functions, APIs, and tools to take actions beyond text generation. Instead of just describing what should happen, AI with tool use can actually read files, run code, search the web, query databases, and interact with services — making it genuinely agentic.

Origin

Introduced by OpenAI in 2023 with function calling, and rapidly adopted by Anthropic, Google, and other model providers. MCP (Model Context Protocol) standardized how tools connect to AI models.

Example

You ask AI to 'check the current weather in Tokyo.' Without tool use, it guesses based on training data. With tool use, it calls a weather API, gets real-time data, and gives you the actual current temperature.

Tool use transforms AI from a conversationalist into an actor. It's the capability that makes agentic coding possible.

Without vs With Tool Use

Without Tool UseWith Tool Use
Generates text about codeReads and writes actual files
Describes what to doDoes it
Suggests commandsRuns commands
Imagines resultsObserves real results

Common Tools AI Uses

ToolWhat It Does
File read/writeAccess and modify code files
TerminalRun shell commands
Web searchFind current information
Database queryRead and write data
API callsInteract with external services
Code executionRun code and observe output

How Tool Use Works

  1. AI analyzes your request — Determines what tools are needed
  2. AI calls a tool — Sends a structured request
  3. Tool executes — Performs the action and returns results
  4. AI processes results — Uses the output to continue working
  5. Repeat — AI may call multiple tools in sequence

Tool Use and MCP

MCP (Model Context Protocol) standardizes how tools connect to AI. Instead of each AI tool building custom integrations, MCP provides a universal protocol — like USB for AI tools.

Why It Matters for Vibe Coding

Tool use is what makes the difference between AI that talks about code and AI that writes, tests, and deploys code. Every agentic coding feature you use — Cursor's agent mode, Claude's computer use — relies on tool use under the hood.