Skip to content

Tool Use for AI Agents: How Agents Operate Your Systems

A language model on its own only produces text. To check an order in your ERP, open a support ticket or save a draft quote, an AI agent needs tools and a way to call them. That mechanism is called tool use, or function calling. This guide explains it across vendors and covers the decisions that matter in practice: how to shape tools, how far to trust write access, and when to fall back to screen automation. Vendor documentation was checked in November 2026.

What is LLM tool use, and what is it for?

Tool use means the model decides it needs a function to answer, and instead of prose it emits a structured request naming the function and its arguments. Your application runs that function and hands the result back. This turns a text generator into an agent that can look things up and act in real systems.

The two terms are interchangeable. Anthropic's tool use documentation says tool use is "also called function calling"; OpenAI and Google use "function calling". For a short definition, see the glossary entry What Is Tool Use (Function Calling)?. This page goes further.

What businesses typically use it for:

  • Looking things up: stock levels, order status, a customer's history in Salesforce or HubSpot, a serial number in the service system.
  • Calculating: pulling prices from a price list, lead times from the ERP, dimensions from a bill of materials.
  • Producing documents: a draft quote as a Word file, an inspection report as a PDF, a summary saved to SharePoint.
  • Taking action: raising a ticket, drafting an email to a supplier, updating a CRM record.

The first three either read data or produce drafts. Only the last one changes records in your systems, and that is where most of the risk sits. For how agents fit into processes such as quoting, service or sales, see the overview of AI agents for businesses.

How does function calling work, step by step?

Function calling is a loop of requests. Your application sends the user's question plus tool descriptions; the model replies with a call; your code runs it and returns the result; the model either answers or asks for more calls. OpenAI, Anthropic and Google all follow this same loop, with different field names.

OpenAI's function calling guide lists five steps: send a request with the tools the model could call, receive a tool call, execute code on the application side, send a second request with the tool output, then receive a final response "or more tool calls". Google's Gemini documentation describes the same pattern and stresses that the model does not execute the function itself.

Defining a tool

Every tool has three parts: a unique name, a natural-language description, and a JSON Schema for its inputs. Anthropic calls the schema input_schema; OpenAI and Google call it parameters. Here is a read-only tool for checking an order:

{
  "name": "erp_get_order",
  "description": "Returns status, line items and delivery date for an existing sales order. Read-only. Use when someone asks where an order stands.",
  "input_schema": {
    "type": "object",
    "properties": {
      "order_number": {
        "type": "string",
        "description": "Sales order number, format SO-123456"
      }
    },
    "required": ["order_number"]
  }
}

The description does real work. According to Anthropic, Claude decides when to call a tool based on the user's request and the tool's description. Vague descriptions lead to wrong calls, or none at all.

The call and the result

With Claude, the response ends with stop_reason: "tool_use" and contains a tool_use block holding an id, the tool name and its input. Your code runs the function and replies with a tool_result block carrying the same tool_use_id. If execution fails, Anthropic's guide to handling tool calls says to set is_error: true and put the error text in the content. When parameters are missing, the same guide reports that Claude retries two to three times with corrections before apologising to the user.

OpenAI and Gemini use different names for these fields, but the contract is identical: a call with an identifier goes out, a result with the same identifier comes back.

Controls: whether, how many, how strict

The three vendors offer comparable controls:

  • Optional or forced. By default the model decides (auto). You can force a call (Anthropic any or a named tool; OpenAI required or a named function; Gemini any) or forbid calls (none). OpenAI also offers "allowed tools", which restricts a request to a subset of the defined tools.
  • Parallel calls. Models can call several independent tools in a single turn. Anthropic lets you switch this off with disable_parallel_tool_use; OpenAI with parallel_tool_calls: false. Google also documents "compositional" calling, where one call's result feeds the next.
  • Schema adherence. Setting strict: true (Anthropic, OpenAI) or using Gemini's validated mode keeps arguments in line with your schema. Anthropic says strict tool use guarantees that inputs "always match your schema exactly". OpenAI's strict mode requires, among other things, additionalProperties: false and every property listed as required.

A valid schema only means the shape is right. Whether that order number exists, and whether this user may see it, is still your code's job.

Client tools and server tools

Anthropic separates tools by where they run. Client tools run in your application; that includes every tool you define yourself, so all your ERP and CRM integrations. Server tools such as web search or code execution run on Anthropic's infrastructure, and you just see the result. For internal business systems you will almost always use client tools, because only your application can reach your network and credentials.

What are the main ways to give agents tools?

There are four routes: functions defined directly in your agent's code, tools exposed via the Model Context Protocol, vendor-hosted server tools, and, as a last resort, screen automation. Which one fits depends on how many agents need the same tools and whether the target system has an API at all.

Functions defined in code. The simplest option. You describe the tools inside your agent and call your REST API or database behind them. Ideal for a single agent with a handful of well-defined tools. The downside: every new agent redefines the same tools.

Model Context Protocol (MCP). MCP standardises how tools and data sources are offered to agents. One MCP server wraps your CRM once, and any compatible agent can use it. The distinction from plain function calling: MCP handles publishing and discovering tools, while the call itself still runs through tool use. Our guide Model Context Protocol (MCP): Connecting Agents the Standard Way covers this in detail.

Vendor server tools. Web search, page fetching or sandboxed code execution come ready-made from providers such as Anthropic. They save engineering time but run outside your infrastructure. Useful for research tasks, rarely right for internal data.

Computer use as a fallback. If a legacy system has no API, an agent can drive it through screenshots, mouse and keyboard. Anthropic's computer use tool documentation recommends a dedicated virtual machine or container with minimal privileges, an allowlist of domains, and a human to confirm decisions with real-world consequences. It also warns that instructions on web pages or in images may override yours. Treat computer use as a bridge until an API exists, not as the default.

Two deeper guides are in preparation: one on designing tools (scope, descriptions, error messages) and one on separating read and write tools for ERP and CRM. Once published, they will appear on this page in the list of articles on the topic.

What makes a good tool for an agent?

A good agent tool maps to a business task, not to a raw API endpoint. It has an unambiguous name, a description written as if for a new hire, returns readable data rather than opaque IDs, and produces error messages that tell the agent what to do differently next time.

In September 2025 Anthropic's engineering team published Writing effective tools for agents. Its key recommendations, applied to business systems:

  • Consolidate. Rather than separate find_customer, list_orders and get_order_details tools, a single order_status_for_customer tool can run the usual chain in one call. The article warns that overlapping tools distract agents.
  • Namespace by system. Prefixes such as erp_…, crm_… or dms_… make clear which system a tool touches. Anthropic suggests testing naming schemes against your own evaluations.
  • Return meaningful context. Resolve internal IDs into names a person would recognise. Optionally let the agent choose between concise and detailed responses.
  • Be economical with tokens. Paginate, filter or truncate large results, with sensible defaults. A query returning 5,000 order lines floods the context window and degrades the answer.
  • Write useful errors. Not "Error 400" but "Order number missing or malformed; expected SO-123456". Anthropic's API docs make the same point: "Rate limit exceeded. Retry after 60 seconds." beats a bare "failed".
  • Name parameters precisely. customer_id rather than customer, delivery_date_iso rather than date.

In our own operations, the habit that pays off most is running each new tool against three to five realistic requests and reading the logs. Where does the agent pick the wrong tool, or guess a parameter? The fix is nearly always in the description.

What do you need in place first?

You need three things: systems with reachable interfaces, a dedicated identity with exactly the right permissions, and a clear business decision on which steps the agent may perform alone and which need human sign-off. The choice of model or framework matters less, because every major vendor supports function calling.

Systems and interfaces. Your ERP, CRM, document store or ticketing system needs an API, a database view or at least an export. Check for sandbox or test environments; agents should not be tried out on production data.

Identity and permissions. The agent needs its own credentials, never a shared admin account. The OWASP entry on Excessive Agency recommends executing extensions in the context of the specific user with minimal scope, and enforcing authorisation in the downstream system.

Data quality. Read tools are only as reliable as the data behind them. An agent checking stock levels inherits every inaccuracy in your inventory records; poor master data does not get better, it just gets exposed faster.

Ownership. Decide who owns the agent from a business perspective, who approves its actions and who reviews its logs. Where agents process employee data, involve your works council, staff representatives or data protection officer early, depending on your jurisdiction. This is general guidance, not legal advice.

How should you roll it out?

Start from a concrete task, not from a system. Begin with read-only tools, measure quality on real cases, and only then enable actions that change data: first as drafts awaiting approval, later selectively automated.

  1. Pick one task. For example "tell a customer where their order is" or "pull matching items and prices from the price list for an enquiry", typical of agents for quotation work.
  2. Derive the tools. Which two to five tools does exactly this task need? Leave everything else out.
  3. Build read-only. Connect tools with read permissions only; write clear descriptions and error messages.
  4. Test on real cases. Replay 20 to 50 historical requests, read the logs, sharpen the descriptions.
  5. Write as drafts. The agent creates quotes, emails or tickets as drafts; a person reviews and releases them.
  6. Automate selectively. Only low-impact actions with a strong test record run without approval, with logging and limits.
  7. Operate it properly. Log every tool call with inputs, output and user context.

What are the limits and risks?

The biggest risk is not a wrong sentence but a wrong action: an agent that can do more than it should and, through a mistake or manipulated input, triggers something harmful. OWASP lists this as its own vulnerability, Excessive Agency, with three root causes: excessive functionality, excessive permissions and excessive autonomy.

Excessive functionality. A generic tool such as "run SQL" or shell access can do anything, including delete. OWASP advises avoiding open-ended tools in favour of narrowly scoped ones.

Excessive permissions. If a tool only reads orders, the account behind it should only be able to read orders. OWASP's principle of complete mediation is key here: authorisation belongs in the downstream system, not in the prompt. A language model is not an access control layer.

Excessive autonomy. Consequential actions such as purchase orders, price changes or messages to customers need human approval. OWASP notes that logging, monitoring and rate limiting do not prevent excessive agency, though they can limit the damage.

Indirect prompt injection. Tool results often carry outside content: web pages, inbound email, uploaded files. Anthropic warns that an attacker may hide instructions there and advises treating such content as untrusted and keeping it inside tool_result blocks rather than the system prompt. An agent that reads inbound email and can also trigger payments is a dangerous combination.

Guessed parameters. Anthropic's documentation notes that more capable models are more likely to spot a missing parameter and ask for it, while others may infer a plausible but invented value. For required identifiers such as order numbers, your code should verify the value exists rather than trusting it.

Cost and latency. Every tool definition consumes input tokens and every call adds another model round trip. Anthropic's pricing notes confirm that tool definitions, tool_use blocks and tool_result blocks all count as tokens. Dozens of poorly scoped tools make an agent slower and more expensive.

When tool use is the wrong choice. If a fixed, repeatable flow is enough, a conventional integration or workflow tool is simpler, cheaper and more predictable. Tool-using agents earn their keep where requests vary and the route to an answer changes each time.

How do you get started?

Choose a frequent, well-bounded question that someone currently answers by checking two or three systems. Build only read-only tools for it and test against real cases. Once the answers are right, add drafts, and only after that, actions that write data.

A practical sequence for the first few weeks:

  • Inventory: which systems have a usable API, where are test environments, who manages credentials?
  • One use case: for example order status in technical service, or searching manuals and inspection reports for knowledge management.
  • Two to five tools: clearly named, with descriptions a new colleague would understand.
  • Strict schemas: strict: true or your vendor's equivalent, plus your own sanity checks.
  • A dedicated read-only account: no shared credentials.
  • Logging from day one: every call with inputs and output.

When several agents need the same systems, moving to MCP means you build each tool once. For how tools fit into the wider picture of agents, processes and operations, see AI agents.

Frequently asked questions

Does the model execute the function itself?

No. The model only produces a structured request with a function name and arguments. Your application runs it, except for provider-hosted server tools, which run on the vendor's infrastructure.

How is tool use different from MCP?

Tool use is the model's ability to request a function call. The Model Context Protocol is an open standard for exposing tools and data sources to agents; the actual calls still go through tool use.

Should an agent get one tool per API endpoint?

Usually not. Anthropic's engineering team recommends a few tools built around high-impact workflows, and OWASP lists unnecessary functionality as a root cause of excessive agency.

Can an agent write directly to our ERP?

It can, but only with narrowly scoped credentials, authorisation enforced by the ERP itself and human approval for consequential actions. Most teams begin with read-only tools and drafts.

When does computer use make sense?

Only when a system has no usable API. Driving a screen is slower and more fragile than an API call and needs an isolated environment.

Sources

  1. Anthropic: Tool use with Claude platform.claude.com
  2. Anthropic: Handle tool calls platform.claude.com
  3. Anthropic: Computer use tool platform.claude.com
  4. OpenAI: Function calling developers.openai.com
  5. Google: Function calling with the Gemini API aistudio.google.com
  6. Anthropic Engineering: Writing effective tools for agents — with agents anthropic.com
  7. OWASP: LLM06:2025 Excessive Agency genai.owasp.org