Resources

Fundamentals

What is AI agent tool use?

How AI agents choose and call external tools, what can go wrong, and what teams should validate before production use.

10 min readUpdated 2026-07-02
AI agentsTool useAutomationMCP

Written by RTT Intelligence Engineering

Technical notes from the team building MCP surfaces for OpenAPI APIs and database scopes with server-side credentials, validation, and audit-oriented logs.

Reviewed for practical implementation

Focused on usable architecture, security boundaries, and production tradeoffs rather than generic definitions.

Definition

AI agent tool use means a model can call external capabilities instead of only generating text.

A tool might search a database scope, create a ticket, fetch an order, run a calculation, or call an internal service. The agent decides when a tool is needed, sends structured input, receives the result, and continues the workflow.

Tool use is what turns a chat experience into a workflow. The model is no longer only answering from its own context; it can ask a system for current data or request an action.

That is useful, but it also changes the risk profile. A wrong answer is one problem. A wrong tool call can touch a customer record, create a ticket, query a database, spend quota, or trigger an operational workflow.

The tool-use loop

A tool-using agent usually follows a loop of understand, choose, call, observe, and continue.

  • Understand the user request and the available context.
  • Decide whether an external tool is needed.
  • Choose a tool from the available catalog.
  • Build structured arguments that match the tool schema.
  • Send the call through the client or server layer.
  • Read the tool result, validation error, or failure response.
  • Continue with another tool call, ask for clarification, repair the arguments, or answer the user.

Practical example

A support assistant can use tools without receiving broad access to every backend system.

Imagine a user asks which open Acme orders need support follow-up. A tool-using agent should not receive a generic database login or a full internal API key. It should see a small set of tools that match the workflow.

The catalog might include search_orders, get_customer_status, and create_support_ticket. The model can first search open orders, inspect the result, and only create a ticket if the user confirms the action or the workflow policy allows it.

StepAgent behaviorControl that should exist
SearchCalls search_orders with customer and status filters.Filters, row limits, and published-field checks.
InspectReads the returned order summary and identifies delayed shipments.Result fields are limited to what the workflow needs.
ActCalls create_support_ticket only with confirmed customer, subject, priority, and message.Write tools have clear descriptions, required arguments, and audit logs.
ExplainSummarizes what was found and what action was taken.Logs link the answer to tool calls without storing secrets.

What can go wrong

Tool use can fail when tools are too broad, descriptions are unclear, or execution is trusted too early.

RiskWhat it looks likePractical control
Wrong tool selectionThe agent calls create_ticket when a read-only status lookup was enough.Use precise descriptions, hide confusing tools, and test realistic questions.
Weak argumentsThe agent omits a required customer ID or sends an overly broad date range.Validate schemas, required fields, enums, limits, and date windows before execution.
Over-broad accessOne tool can query every table or call every admin route.Publish narrow tools and use scope, table, column, and operation permissions.
Prompt injectionUser or retrieved content tells the agent to ignore policy and call a sensitive tool.Keep policy in backend validation, not only in prompts or tool descriptions.
Sensitive loggingTool arguments or results store tokens, emails, phone numbers, or connection strings.Redact sensitive values before persistence and limit result fields.
Runaway usageThe agent retries calls or loops through large result sets.Add quotas, rate limits, timeouts, max rows, and failure handling.

What good tools look like

Good tools are boring in the best way: named clearly, described precisely, validated strictly, and easy to observe.

  • The tool name maps to one understandable action or lookup.
  • The description says when to use it, when not to use it, and what result it returns.
  • The input schema is structured instead of one broad natural-language instruction field.
  • The execution path maps to a known API operation, database scope, or workflow, not arbitrary client-supplied code.
  • The server checks identity, ownership, publication state, scope, arguments, limits, and policy before execution.
  • The result is small enough for the next reasoning step and does not include unnecessary internal fields.
  • Logs show which tool ran, who called it, whether validation passed, how long it took, and what failed when it failed.

Read tools and write tools need different review

Not every callable capability has the same risk.

Tool typeExampleRollout advice
Read-only lookupget_customer_statusGood first tool when returned fields are limited and logged.
Search/listsearch_ordersRequire filters, max rows, sorting rules, and result-size controls.
Database executorexecute_query_planUse scope, table, column, relationship, limit, and read-only validation.
Write actioncreate_support_ticketRequire clearer descriptions, required arguments, confirmation rules, and audit logs.
Administrative actiondelete_user or rotate_tokenHide by default unless there is a very narrow reviewed workflow.

Production checklist

Before broad rollout, test the tool surface the same way you would test an external integration.

  • Start with one workflow and a small tool catalog.
  • Write descriptions for model tool choice, not only for human API documentation.
  • Keep upstream API credentials and database connection strings server-side.
  • Validate arguments before calling APIs, executors, or workflows.
  • Use metadata-only schema tools for database context and separate executor tools for data access.
  • Apply per-tool and per-account limits, quotas, timeouts, and max result sizes.
  • Redact secrets and sensitive fields before logging request or response details.
  • Test in a controlled chat or client before exposing the tool surface to more users.
  • Review logs for wrong tool selection, repeated failures, high latency, and unexpected result size.

MCP's role

MCP gives tool-using agents a standard catalog and call interface.

Instead of embedding every integration directly into each agent, teams can expose a stable tool surface. The server-side layer can then control which tools exist, how they are called, and what is logged.

MCP is especially useful when several clients need the same capabilities. The tool catalog can be published once, tested once, and then used by compatible AI applications with the right URL and authentication.

MCP is not a substitute for authorization, validation, or security review. It is the interface. The server or Gateway still has to enforce the rules.

Sources and further reading

Common questions

Is tool use the same as automation?

Not exactly. Tool use gives an AI system callable capabilities. Automation depends on how those tools are orchestrated and governed.

Can an agent call multiple tools in one task?

Yes. A workflow may inspect context with one tool and take action with another, as long as each call is allowed by policy.

What is the safest way to start?

Start with narrow, read-only, well-described tools and add broader actions only after logs and validation are working.

Does a tool-using agent need direct access to my API keys?

No. A safer pattern keeps upstream credentials in backend infrastructure and gives the agent or MCP client a scoped way to call approved tools.

How do I know whether a tool description is good enough?

Ask realistic questions in a test client and inspect tool choice. If the model picks the wrong tool, passes weak arguments, or cannot tell lookup from search, the description or catalog is not clear enough.

Should write actions be exposed to agents?

Only after the workflow is clear. Write actions need tighter schemas, confirmation expectations, audit logs, limits, and a way to disable or narrow the tool quickly.

Is MCP required for AI agent tool use?

No. Agents can use tools through model-specific function calling or custom application code. MCP is useful when teams want a reusable client-server tool surface across compatible AI clients.