---
title: "Tool use (function calling)"
description: "When an AI asks other software to do a job, such as check stock or look up an order, then uses the result in its answer."
url: https://ursy.com/wiki/tool-use/
updated: 2026-11-26T15:48:10+00:00
publisher: URSY (https://ursy.com/)
cite: Name URSY and link https://ursy.com/wiki/tool-use/
---

# Tool use (function calling)

> When an AI asks other software to do a job, such as check stock or look up an order, then uses the result in its answer.

**Tool use, also called function calling, is when an AI model asks other software to do a job, such as search stock, check a diary or look up an order, and then uses the result in its answer.** The model does not run the job itself. It writes a structured request, your software or the AI company’s runs it, and the answer goes back to the model. This is how [AI assistants](https://ursy.com/wiki/ai-assistant/) move from talking to doing.

## What is tool use? {#what-is-tool-use}

A tool is a job described in a fixed format: a name, a plain description and the inputs it needs. Anthropic’s documentation says Claude “determines when to call a tool based on the user’s request and the tool’s description”, then returns a structured call. OpenAI describes the same idea as function calling. The model is still a [large language model](https://ursy.com/wiki/large-language-model/); tools give it hands. An [AI agent](https://ursy.com/wiki/ai-agent/) is, in large part, a model using tools in a loop.

## How does the loop work? {#how-does-the-loop-work}

OpenAI’s guide sets out five steps, and Anthropic’s documentation describes the same round trip:

1. Your application sends the user’s question with the list of tools the model may call.
2. The model replies with a tool call. In Claude’s case the reply has `stop_reason: "tool_use"` and a `tool_use` block.
3. Your code runs the job with the inputs the model chose.
4. Your code sends the result back. Claude calls this a `tool_result` block.
5. The model writes the answer, or asks for another tool if the task needs more steps.

Each request to the model costs [AI tokens](https://ursy.com/wiki/ai-tokens/), and everything in the loop must fit in the model’s [context window](https://ursy.com/wiki/context-window/).

## Client tools and server tools {#client-tools-and-server-tools}

Anthropic sorts tools by where the code runs. Client tools run in your own application: tools you define, plus tools with Anthropic-defined schemas such as `bash` and `text_editor`. Server tools run on Anthropic’s own systems: its documentation names `web_search`, `web_fetch`, `code_execution` and `tool_search`. With a server tool you see the result without running anything. Anthropic also offers an MCP connector, to reach remote MCP servers straight from its API.

## Why does it matter for search? {#why-does-it-matter-for-search}

When an AI assistant searches the web, that is tool use. A web search or web fetch tool goes out, reads pages and brings back text for the model. So the plain basics of [technical SEO](https://ursy.com/wiki/technical-seo/) still decide whether your page is found and read. A fetch made for a person shows in your logs under the fetcher’s name, such as [ChatGPT-User](https://ursy.com/wiki/chatgpt-user/), not as a browser. See [live fetcher](https://ursy.com/wiki/live-fetcher/), [user agent](https://ursy.com/wiki/user-agent/) and [AI search](https://ursy.com/wiki/ai-search/).

## Why does it matter for AI answers? {#why-does-it-matter-for-ai-answers}

A tool result is fresh evidence the model builds its answer on. That is [grounding](https://ursy.com/wiki/grounding/), and it is the idea behind [retrieval-augmented generation](https://ursy.com/wiki/retrieval-augmented-generation/). If the tool returns your live price, the answer can be right today. If it returns an old page, the answer is wrong with confidence, which looks like an [AI hallucination](https://ursy.com/wiki/ai-hallucination/). For a business, offering a tool that returns true facts, for example through [MCP](https://ursy.com/wiki/mcp/), beats hoping the model guesses well. See [callable entity](https://ursy.com/wiki/callable-entity/).

## The same idea in three formats {#the-same-idea-in-three-formats}

|  | Anthropic (Claude) | OpenAI | MCP |
| --- | --- | --- | --- |
| Tool name | `name` | `name` | `name` |
| What it does | `description` | `description` | `description` (plus an optional `title`) |
| Inputs | `input_schema` | `parameters` | `inputSchema` |
| Exact inputs only | `strict: true` | `strict` | Server validates inputs |
| The call | `tool_use` block | Tool call | `tools/call` request |

All three describe inputs with JSON Schema, so one well-written tool can be offered in each. The MCP specification adds `tools/list`, so an AI app can ask a server which tools it has.

## A worked example {#a-worked-example}

A bike shop gives its website assistant one tool. In the format Anthropic’s documentation uses for its own `get_weather` example, the definition is:

```
{
  "name": "check_stock",
  "description": "Check how many of a product are in stock at the shop, using the product's SKU.",
  "input_schema": {
    "type": "object",
    "properties": {
      "sku": {
        "type": "string",
        "description": "The product SKU, e.g. LIGHT-SET-01"
      }
    },
    "required": ["sku"]
  }
}
```

A customer asks: “Have you got the commuter light set in stock?” The round trip then goes:

1. The model replies with `stop_reason: "tool_use"` and a `tool_use` block asking for `check_stock` with `{"sku": "LIGHT-SET-01"}`.
2. The shop’s own code looks up the stock system and sends the answer back in a `tool_result` block, for example “3 in stock”.
3. The model writes the reply: “Yes, we have 3 in stock.”

Anthropic calls tools like this, which run in your own application, client tools. See [what is a SKU](https://ursy.com/wiki/what-is-a-sku/).

## What if a detail is missing? {#what-if-a-detail-is-missing}

Anthropic warns that when a question lacks a required detail, Claude Opus is “much more likely” to ask for it, but Claude Sonnet “might also infer a reasonable value”. If the customer only says “Have you got lights?”, the assistant could pick a SKU on its own. Clear descriptions, `strict: true`, and code that checks the input guard against that. The MCP specification goes further: servers “MUST” validate all tool inputs.

## What does tool use cost? {#what-does-tool-use-cost}

Tool definitions are not free. OpenAI says functions are “injected into the system message”, count against the context limit and are “billed as input tokens”. Anthropic says the same for the tool names, descriptions and schemas, and adds a tool use system [prompt](https://ursy.com/wiki/prompt/): 286 tokens for Claude Opus 5.5, on its pricing table checked 24 November 2026. Server tools such as web search can add their own charges. OpenAI suggests “fewer than 20 functions available at the start of a turn”. See [AI inference](https://ursy.com/wiki/ai-inference/).

## What are the risks? {#what-are-the-risks}

A tool can act in the real world, so mistakes cost more than a wrong sentence. The MCP specification says there “SHOULD always be a human in the loop with the ability to deny tool invocations”, and that clients should ask for confirmation on sensitive operations. Tool results are also a route for [prompt injection](https://ursy.com/wiki/prompt-injection/): a page or review read by a fetch tool can carry planted instructions. Servers must also rate limit calls. See [AI guardrails](https://ursy.com/wiki/ai-guardrails/) and [rate limiting](https://ursy.com/wiki/rate-limiting/).

## Common mistakes {#common-mistakes}

- Vague descriptions. The model picks tools by their words, so “Gets data” helps nobody.
- Too many tools, so the model wastes tokens and picks the wrong one.
- Asking the model for values your code already knows, such as the shop’s own ID. OpenAI’s guide says to keep those in code.
- No input checks, so a guessed SKU returns the wrong product.
- A tool whose data differs from the public page. People and AI then see two different prices.
- Payments or bookings with no human confirmation step. See [agentic commerce](https://ursy.com/wiki/agentic-commerce/) and [instant checkout](https://ursy.com/wiki/instant-checkout/).

## How to check it {#how-to-check-it}

1. List the jobs you would let an AI do for a customer: check availability, give a delivery date, book a slot. For each, ask where the true answer lives today: a page, a feed or a system.
2. Check which doors your site already offers machines with [AI Agent Readiness](https://ursy.com/agent-readiness-checker/): OpenAPI, .well-known files, MCP and agent instructions. Our own [MCP server](https://ursy.com/mcp/) and [API](https://ursy.com/api/) pages show one working example.
3. Check your guide for AI apps with the [llms.txt Checker](https://ursy.com/llms-txt-checker/) and your clean page copies with the [Markdown Version Checker](https://ursy.com/markdown-version-checker/). See [llms.txt](https://ursy.com/wiki/llms-txt/).
4. Make sure the same facts are on your public pages. The [Schema Markup Checker](https://ursy.com/schema-checker/) shows the facts in your page code; the [AI Consistency Checker](https://ursy.com/ai-consistency-checker/) shows whether page, schema, llms.txt and feeds agree; the [Product Page Checker](https://ursy.com/product-page-checker/) covers shop pages. See [schema markup](https://ursy.com/wiki/schema-markup/) and [JSON-LD](https://ursy.com/wiki/json-ld/).
5. Look for planted instructions that a fetch tool might pass to a model with the [Prompt Injection Checker](https://ursy.com/prompt-injection-checker/).
6. Check that fetch tools can reach you. The [Robots.txt Checker](https://ursy.com/robots-txt-checker/) and [AI Bot Checker](https://ursy.com/ai-bot-checker/) show what your rules let in; [Verify an AI Bot](https://ursy.com/verify-ai-bot/) checks a named visitor is real; the [AI Crawler Log Analyser](https://ursy.com/ai-crawler-log-analyzer/) reads a server log in your browser. See [robots.txt](https://ursy.com/wiki/robots-txt/) and [log file analysis](https://ursy.com/wiki/log-file-analysis/).
7. Paste a tool definition into the [JSON Formatter](https://ursy.com/webmaster-tools/json-formatter/) to catch broken JSON, and estimate what long descriptions cost with the [AI Token Cost Estimator](https://ursy.com/webmaster-tools/ai-token-cost-estimator/).
8. Get an overall score with the [AI Readiness Checker](https://ursy.com/ai-readiness-checker/). Single checks on each tool page: free, no account (2 a day). The full audit: a free account (sign in with an emailed code), 1 a day.
9. Over time, [MCP and agent call analytics](https://ursy.com/pro/mcp-and-agent-call-analytics/) shows what AI agents asked your site, step by step, and [AI agent orders](https://ursy.com/pro/ai-agent-orders/) shows orders started or finished by AI assistants. Both are in URSY Pro, opening in stages.

## What URSY.com counts {#what-ursy-counts}

Tool use reaches a website in two ways, and we count both. A fetch tool reading your page is a request with the fetcher’s name, such as ChatGPT-User or Claude-User; we sort it as an [AI crawler](https://ursy.com/wiki/ai-crawler/), note that it fetched for a person, and check its address against the company’s published list. A call to an API or MCP server we run is one row in our API/MCP log: which tool, when, which app, and the result. We cannot see what happens inside the AI app before or after the call. See [methodology](https://ursy.com/methodology/).

## Questions {#questions}

### Is tool use the same as an AI agent? {#is-tool-use-the-same-as-an-ai-agent}

Not quite. Tool use is one call. An agent uses tools in a loop, deciding each next step from the last result.

### Do I need MCP to offer tools to AI? {#do-i-need-mcp-to-offer-tools-to-ai}

No. Each AI company has its own tool format. MCP is an open standard that lets one server work with many AI apps.

### Can an AI buy something through a tool? {#can-an-ai-buy-something-through-a-tool}

Yes, if a tool allows it. That is why the MCP specification asks for a human who can deny tool calls, and confirmation on sensitive steps.

### Why did the assistant quote an old price? {#why-did-the-assistant-quote-an-old-price}

It probably read a cached page or old data, not a live tool. Make one source of truth and serve it to pages, feeds and tools alike.

### Will my server logs show tool use? {#will-my-server-logs-show-tool-use}

Fetches show as named requests, if the fetcher sends its name. Calls to your own API or MCP server show in that server’s log.

## Related words {#related-words}

- [MCP (Model Context Protocol)](https://ursy.com/wiki/mcp/)
- [AI agent](https://ursy.com/wiki/ai-agent/)
- [Agentic commerce](https://ursy.com/wiki/agentic-commerce/)
- [Callable entity](https://ursy.com/wiki/callable-entity/)
- [Grounding](https://ursy.com/wiki/grounding/)
- [Live fetcher](https://ursy.com/wiki/live-fetcher/)
- [System prompt](https://ursy.com/wiki/system-prompt/)
- [Prompt injection](https://ursy.com/wiki/prompt-injection/)
- [Agentic web](https://ursy.com/wiki/agentic-web/)

## Sources {#sources}

- [Claude Docs: Tool use with Claude](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview), checked 24 November 2026
- [OpenAI API docs: Function calling](https://developers.openai.com/api/docs/guides/function-calling), checked 24 November 2026
- [Model Context Protocol specification (2025-11-25): Tools](https://modelcontextprotocol.io/specification/2025-11-25/server/tools), checked 24 November 2026
- [Model Context Protocol: What is MCP?](https://modelcontextprotocol.io/docs/getting-started/intro), checked 24 November 2026

*Updated 24 November 2026 by URSY.com.*
