Skip to the content
Start free

Tool use (function calling)

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 move from talking to doing.

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; tools give it hands. An AI agent is, in large part, a model using tools in a loop.

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, and everything in the loop must fit in the model’s context window.

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.

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 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, not as a browser. See live fetcher, user agent and AI search.

Why does it matter for AI answers? #

A tool result is fresh evidence the model builds its answer on. That is grounding, and it is the idea behind 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. For a business, offering a tool that returns true facts, for example through MCP, beats hoping the model guesses well. See callable entity.

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 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.

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? #

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: 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.

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: a page or review read by a fetch tool can carry planted instructions. Servers must also rate limit calls. See AI guardrails and rate limiting.

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 and instant checkout.

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: OpenAPI, .well-known files, MCP and agent instructions. Our own MCP server and API pages show one working example.
  3. Check your guide for AI apps with the llms.txt Checker and your clean page copies with the Markdown Version Checker. See llms.txt.
  4. Make sure the same facts are on your public pages. The Schema Markup Checker shows the facts in your page code; the AI Consistency Checker shows whether page, schema, llms.txt and feeds agree; the Product Page Checker covers shop pages. See schema markup and JSON-LD.
  5. Look for planted instructions that a fetch tool might pass to a model with the Prompt Injection Checker.
  6. Check that fetch tools can reach you. The Robots.txt Checker and AI Bot Checker show what your rules let in; Verify an AI Bot checks a named visitor is real; the AI Crawler Log Analyser reads a server log in your browser. See robots.txt and log file analysis.
  7. Paste a tool definition into the JSON Formatter to catch broken JSON, and estimate what long descriptions cost with the AI Token Cost Estimator.
  8. Get an overall score with the 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 shows what AI agents asked your site, step by step, and AI agent orders shows orders started or finished by AI assistants. Both are in URSY Pro, opening in stages.

What URSY.com 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, 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.

Questions #

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? #

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? #

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? #

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? #

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.

Sources #

Updated 24 November 2026 by URSY.com.

Cite this page: Tool use (function calling). URSY. Updated 26 November 2026. https://ursy.com/wiki/tool-use/ · Section links

Tools for this

  • LiveVerify an AI Botis it really GPTBot? IP, published lists and user agentRun the check →
  • LiveCore Web Vitals Checkerreal-user speed and its historyRun the check →
  • LiveWordPress Security Checkeropen user lists, author pages and APIsRun the check →
  • ProReal-user speedCore Web Vitals from your own visitorsIn URSY Pro →
  • ProAsset diet reportScripts and styles each page type loads but never usesIn URSY Pro →

All 871 wiki entries, A to Z →