← AI Terminology

Tool Use / Function Calling

Tool use (also called function calling) is an LLM capability where the model generates structured requests to invoke external tools — APIs, code execution environments, databases, or services — and incorporates the tool's response into its reasoning, extending its capabilities beyond static knowledge.

It is the foundation of AI agents that can act on the world.
Why It Matters in AI
Without tool use, LLMs are read-only oracles: they cannot fetch current data, execute code, query databases, or take actions. Tool use changes this fundamentally: a model with a web search tool can access real-time information; with a code interpreter it can solve any arithmetic exactly; with a calendar API it can schedule meetings. This capability transforms LLMs from knowledge retrieval systems into action-capable agents — the core of every agentic AI product.
Key Points
Aspect Description
MCP Model Context Protocol standardises tool interfaces across clients — universal tool ecosystem
Safety Tool execution is often sandboxed — especially important for code execution tools
Schema Tools are defined as JSON schemas with name, description, and parameter types — model reads these
Frameworks LangChain tools, LlamaIndex tools, OpenAI tools, Anthropic tools — standardised tool interfaces
Generation Model outputs structured JSON (not plain text) specifying which tool and what arguments
Parallel calling Modern APIs allow multiple tool calls in one turn — model can call search + calculator simultaneously
Simple Analogy
A detective with a smartphone: instead of relying solely on memory and deduction (parametric LLM), they can call for backup (API), search court records (database query), run a licence plate (external service), and execute calculations (code tool). The phone multiplies their investigative capability without changing who they are.
Common Usage Examples
  • Anthropic: tools=[{"name": "get_weather", "description": "Get weather", "input_schema": {"type": "object", "properties": {"city": {"type": "string"}}}}]
  • OpenAI: tools=[{"type": "function", "function": {"name": "search", "parameters": {...}}}]
  • LangChain: @tool def search(query: str) -> str: return web_search(query) — decorator creates tool
  • tool_use_block = response.content[0]; tool_result = execute_tool(tool_use_block.name, tool_use_block.input)
  • Parallel: parallel_tool_calls=True — model calls search + calculator in the same turn
Summary
In short: Tool use allows LLMs to invoke external functions, APIs, and services — transforming them from static knowledge systems into action-capable agents that can search the web, execute code, query databases, and take real-world actions.