# Tool Calling

> Part of the AI Garage Jargons glossary: https://aigarage.in/jargons (all terms: https://aigarage.in/jargons.md)

**Category:** LLM
**Tags:** tools, function-calling, api, agents

A way for a language model to ask your application to run a defined action, by returning a structured request that names the tool and its arguments. Your application runs it and sends the result back. Also called function calling.

**In plain terms:** The model cannot press buttons. It fills in a form that says run this, with these values, hands it to your code, and waits for the answer.

**Use cases:**
- Looking up fresh or private data
- Taking actions such as sending an email or updating a record
- Returning output in a guaranteed shape

**Why it matters:** Tool calling is the bridge between a language model and your systems. It is also where side effects happen, so validation, permissions, and retries are decided in your code, not by the model.

**Why now:** Tool calling is available across major model providers and sits under agents and shared tool protocols. Details differ by provider and change often, so check the current documentation before relying on a specific behavior.

**AI Garage example:** The AI Garage website exposes read-only tools to AI clients, search_jargons and get_jargon. Each has a name, a description, and an input schema, and a public manifest lists them at /api/agent/tools. A client's model can request a call and the site returns the page text. None of them takes personal data or changes anything.

**Mental model:** Tool calling is a contract. You describe each tool with a name, a description, and an input schema. The model decides when a tool fits and returns a call. Your code, never the model, performs the action and returns a result, and the model continues from it. The model acts less like a text generator and more like a caller of typed functions.

**Builder scenario: Let the model request an action without letting it act**

- **Context:** An assistant should issue refunds when a customer's request meets the policy.
- **Failure:** The model replies that the refund is on its way when nothing has happened, or a retried tool call issues the refund twice.
- **Intervention:** Define a refund tool with a schema and let the model request it. The application checks permission and policy, runs the refund with an idempotency key, and returns the real result to the model.
- **Outcome:** The reply states only what the system confirmed, and a retried call resolves to a single refund.

**Common misconceptions:**
- **Claim:** The model runs the tool.
  **Correction:** The model only emits a structured request. Your application, or the provider's servers for hosted tools, executes it and returns the result.
- **Claim:** A strict schema makes a tool call safe.
  **Correction:** A strict schema makes the arguments match the expected shape. Whether the action is allowed, valid, and safe to repeat is decided by your own code.

**Visual model (sequence):** The model asks and your code acts. Every step with a side effect runs in your application.

**Visual description:** A five-step sequence: define the tools, the model requests a call, your application checks and runs it, the result goes back to the model, and the model answers or asks for another tool.

**Related concepts:** [API](https://aigarage.in/jargons/api), [Idempotency](https://aigarage.in/jargons/idempotency), [Decision Model](https://aigarage.in/jargons/decision-model), [Hallucination (AI)](https://aigarage.in/jargons/ai-hallucination), [AI Agent](https://aigarage.in/jargons/ai-agent), [Human in the Loop](https://aigarage.in/jargons/human-in-the-loop), [MCP (Model Context Protocol)](https://aigarage.in/jargons/mcp)

**Last researched:** 2026-10-12

**Sources:**
- [Claude Docs - Tool use with Claude](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview)
- [Claude Docs - How tool use works](https://platform.claude.com/docs/en/agents-and-tools/tool-use/how-tool-use-works)
- [OpenAI API - Function calling](https://developers.openai.com/api/docs/guides/function-calling)

**URL:** https://aigarage.in/jargons/tool-calling
