Illustrated guide to AI agents for developers

developer2026-11-21

On this page

An illustrated guide to AI agents shows how an LLM plans steps, calls tools, and reads results in a loop until a task finishes. For developers, the useful picture is four parts: a model, a set of tools, memory of prior steps, and a loop that decides the next action. MCP tools give an agent a standard way to reach external APIs without custom glue for each one.

What the diagram shows

An agent diagram usually draws a loop. The model receives a goal and the current context. It picks one action, such as a tool call, and the runtime executes it. The result returns to the model, which decides whether to stop or take another step.

  • The model: an LLM that chooses the next action.
  • The tools: functions the agent may call, such as a search or a database query.
  • The memory: the transcript of prior steps and results.
  • The loop: the runtime that repeats the cycle until a stop condition holds.

How tool calls work in practice

The model emits a structured request that names a tool and its arguments. The runtime validates the arguments against the tool schema. It then runs the call and returns JSON. The model reads that JSON and continues.

Schemas matter more than prompts here. A tight schema with typed fields and clear descriptions reduces malformed calls and retries.

Where MCP fits

MCP is an open protocol for exposing tools, resources, and prompts to an agent host. A client connects to an MCP server. It lists the server's tools and calls them over a shared message format. The same server works with any MCP-capable host.

MCP tools for API work let an agent call REST and HTTP endpoints without writing a new adapter for each vendor. Teams still own authentication, rate limits, and error handling.

Paying for API calls from an agent

An agent that calls paid APIs needs a payment path. Some gateways use x402 or MPP to settle small charges in USDC per request. Others bill against a prepaid balance.

APIbase lists tool prices per call. Expect per-call prices between 0 and 29.99 USD, depending on the tool. Check the current price on the tool page before you set a budget cap.

Common failure modes to plan for

  • Without a stop condition, the agent loops forever.
  • The model calls the wrong tool when two tool descriptions overlap.
  • A tool returns a large payload that fills the context window.
  • A retry repeats a paid call that already succeeded.

Set a step limit, cap spend per run, and log each tool call with its arguments and result.

Build a small agent to test the pattern

Start with one model, two tools, and a step limit of ten. Give the agent a task that needs both tools, such as looking up a record and then writing a summary. Read the transcript after each run and tighten the tool descriptions where the model guessed.

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 12 developer tools. The same values are in the table below the chart. Price per call Cache-hit price $0.0 $0.0005 $0.001 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 Discover ToolsDiscover Tools $0.0 $0.0 Batch Tool CallsBatch Tool Calls $0.0 $0.0 Tool Quality MetricsTool Quality Metrics $0.0 $0.0 Tool Quality RankingsTool Quality Rankings $0.0 $0.0 List Programming LanguagesList Programming Languages $0.001 $0.0001 Check CVE ID Reservation Stat…Check CVE ID Reservation Status $0.001 $0.0001 Security Advisories (deps.dev)Security Advisories (deps.dev) $0.001 $0.0001 Dependency Tree (deps.dev)Dependency Tree (deps.dev) $0.001 $0.0001 Package Info (deps.dev)Package Info (deps.dev) $0.001 $0.0001 US dollars per call
Price per call for developer tools, cheapest first.

Data source: live tool catalog snapshot, fetched 2026-11-21.

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
Discover Tools$0.0$0.0
Batch Tool Calls$0.0$0.0
Tool Quality Metrics$0.0$0.0
Tool Quality Rankings$0.0$0.0
List Programming Languages$0.001$0.0001
Check CVE ID Reservation Status$0.001$0.0001
Security Advisories (deps.dev)$0.001$0.0001
Dependency Tree (deps.dev)$0.001$0.0001
Package Info (deps.dev)$0.001$0.0001
ToolProviderPrice/callCache-hit
Usage Time Seriesaccount$0$0
Per-Tool Usage Breakdownaccount$0$0
Usage Summaryaccount$0$0
Discover Toolsapibase$0$0
Batch Tool Callsplatform$0$0
Tool Quality Metricsplatform$0$0
Tool Quality Rankingsplatform$0$0
List Programming Languagesjudge0$0.001$0.0001
Check CVE ID Reservation Statuscve-mitre$0.001$0.0001
Security Advisories (deps.dev)depsdev$0.001$0.0001
Dependency Tree (deps.dev)depsdev$0.001$0.0001
Package Info (deps.dev)depsdev$0.001$0.0001

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 is an AI agent?

An AI agent is a model that runs in a loop. It chooses actions, calls tools, reads the results, and repeats until the task finishes or a limit stops it.

What does an illustrated guide to AI agents usually cover?

A working agent design settles the loop, the model's role, the tool calls, the memory of prior steps, and the stop conditions.

How do MCP tools help an agent?

MCP tools give an agent a standard protocol to list and call external tools, so one client can reach many servers without custom code for each.

Do I need a payment method for agent API calls?

Only for paid endpoints. Pricing varies per tool, and no single price applies to all calls.

  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-11-21Source: live apibase.pro catalog snapshot