How AI agents call tools through MCP

developer2026-12-03

On this page

AI agents call tools through MCP by sending a named request with JSON arguments to a server. The server runs the underlying API call and returns JSON that the model reads. No public transcript or slide deck for a talk by Lauren Tan on this subject was found, so this page explains the mechanics directly.

How a tool call flows

The agent decides that it needs a tool. It picks a tool name from the server's list and writes JSON arguments that match the tool's input schema. The MCP server validates the call, runs the upstream API request, and returns the result.

The model never sees the API key. The server holds the credentials and makes the outbound HTTP request. The model receives only the response.

Each step leaves a trace. Log the tool name, the arguments, the status, and the response size. Those logs show where an agent went wrong, which is faster to read than the full transcript.

What MCP standardises for agents

MCP defines how a client discovers tools, how it calls them, and how results come back. One client can talk to many servers without custom glue code for each API.

  • Discovery: the client lists available tools with descriptions and input schemas.
  • Invocation: the client sends a tool name and its arguments.
  • Results: the server returns content the model can read.

MCP also separates the model from the credentials. The client runs next to the model. The server runs next to the API keys. A team can swap one server for another without rewriting the agent prompt.

Calling a REST API from an agent

A REST API still does the work underneath. The MCP server maps each tool to one endpoint or a small set of endpoints. The agent does not need to know HTTP verbs or URL paths.

Tool descriptions matter. A tool named get_weather with a clear city parameter gives the model fewer ways to misuse it than a generic request tool that accepts any path.

Keep response bodies small. Return only the fields the model needs. Large payloads consume context and slow the next step.

Handling errors and retries

Tool calls fail in predictable ways. The upstream API returns an error code, a timeout occurs, or the arguments fail schema validation. The server should return a clear error message that the model can act on.

Retries need limits. Retry transient failures such as timeouts. Do not retry a write action unless the endpoint is idempotent, because a second call may create a duplicate record.

Keeping secrets out of the model

The model should never see raw API keys. Store keys in the server environment or in a secrets manager. Pass only the tool name and arguments through the agent.

Scope each key to the smallest set of actions the agent needs. A read-only key limits the damage a confused agent can cause.

Paying for tool calls

Some tools charge per call. Per-call prices on the catalog range from None to None USD. The agent should know the cost before it calls a paid tool.

Payment schemes such as x402 are one way to pay for a single request. Check each provider's terms before an agent spends money.

Set a spending cap for each session. Stop the agent when the cap is reached. Record each charge next to the tool call that caused it, so the bill can be traced.

Choosing tools for a developer agent

Developers should pick tools by the job the agent must finish, not by brand. Start with the task. Then match each step to a tool with a clear schema.

  • Read-only lookups for research and checks.
  • Write actions that need a human approval step.
  • Paid calls that need a budget cap.

Test each tool with a few realistic inputs before the agent runs unattended. Failed tests show schema gaps early.

Checking a talk before citing it

Quote a talk only from its recording, its published slides, or a written summary the speaker approved. This page does not attribute claims to Lauren Tan because no verified record of the talk's contents was found.

Live pricing — developer

Price per call, developer tools Horizontal bar chart of the price per call and the cache-hit price, in US dollars, for 8 developer tools. The same values are in the table below the chart. Price per call Cache-hit price $0.0 $0.5 $1.0 Usage Time SeriesUsage Time Series $0.0 $0.0 Per-Tool Usage BreakdownPer-Tool Usage Breakdown $0.0 $0.0 Usage SummaryUsage Summary $0.0 $0.0 Call ToolCall Tool $0.0 $0.0 List Tool CategoriesList Tool Categories $0.0 $0.0 Describe ToolDescribe Tool $0.0 $0.0 Discover ToolsDiscover Tools $0.0 $0.0 Global VIN DecodeGlobal VIN Decode $0.0 $0.0 US dollars per call
Price per call for developer tools, cheapest first.

Data source: live tool catalog snapshot, fetched 2026-12-03.

Chart data as a table
ToolPrice per callCache-hit price
Usage Time Series$0.0$0.0
Per-Tool Usage Breakdown$0.0$0.0
Usage Summary$0.0$0.0
Call Tool$0.0$0.0
List Tool Categories$0.0$0.0
Describe Tool$0.0$0.0
Discover Tools$0.0$0.0
Global VIN Decode$0.0$0.0
ToolProviderPrice/callCache-hit
Usage Time Series$None$None
Per-Tool Usage Breakdown$None$None
Usage Summary$None$None
Call Tool$None$None
List Tool Categories$None$None
Describe Tool$None$None
Discover Tools$None$None
Global VIN Decode$None$None

Connect via MCP

How a tool call worksAn AI agent sends a tool call to the APIbase gateway. The gateway checks payment, calls the provider API, and returns the JSON result to the agent.Your agentAPIbase gatewayProvider API1. tool call2. paid call3. JSON result flows back to the agent
Diagram: the path of one tool call.

Data source: gateway design, no measured values.

$ curl -X POST https://apibase.pro/api/v1/tools/account.timeseries/call \
  -H "Content-Type: application/json" -d '{"params": {}}'

FAQ

What does it mean for an AI agent to talk to tools?

The agent sends a structured request that names a tool and its arguments. A server runs the call and returns a result that the agent reads. The model never handles the API key.

Is there a public transcript of a Lauren Tan talk on AI agents?

We found no public transcript or slide deck for this keyword when this page was written. This page covers the topic directly and does not quote the speaker.

Do I need MCP to give an agent tools?

No. MCP is one standard for the connection. An agent can also call a REST API directly, but each integration then needs its own code and its own credential handling.

How should I limit what an agent can spend?

Set a spending cap for each session and stop the agent when the cap is reached. Per-call prices on the catalog range from None to None USD, so the cap can be sized from that range.

  1. STEP 1/2 Connect your MCP client
  2. STEP 2/2 Browse the full catalog

Written with AI assistance from APIbase's published documentation and public data; checked automatically against them. Corrections: https://apibase.pro/

Published: 2026-12-03Source: live apibase.pro catalog snapshot