Skip to content

What an agent's data lookup really costs — in tokens, dollars, and CO2

← All posts

What an agent's data lookup really costs — in tokens, dollars, and CO2

A first-time data lookup by an agent costs about 26,500 tokens. The same lookup through a pre-built schema costs about 1,500. Everything below is how I measured that gap and what it does to your token bill.

The exploration price is paid every time

When an agent hits an unfamiliar data source, it pays an exploration price. It finds the endpoint, reads the docs, works out auth, parses the response, and maps the fields to what it needs. That work is real, and it is repeated. Every agent pays it. Every session pays it. It is never cached across users.

The common fix is to load tool definitions up front. That is expensive at scale. Five MCP servers run about 55,000 tokens of definitions before the agent does anything useful. 400 tools reach about 405,000. Anthropic has reported internal setups up to 134,000.

Progressive disclosure: search, then call

The counter-move is progressive disclosure. Do not load every tool. Search for the one you need, then call it.

This is not a new idea, and it is not mine. Anthropic reports the same lever for tools. Tool search cut definitions from 77,000 to 8,700 tokens, an 85% drop. Code-execution-with-MCP went from 150,000 to 2,000, a 98.7% drop. Tool-selection accuracy on one model rose from 79.5% to 88.1% over the same change. Pre-built API schemas apply that principle to data sources instead of tools.

The per-lookup arithmetic

Here is the cost of one first-time lookup. Central estimate, modeled on measured web-fetch sizes, with a low and high range:

Per first-time lookuplowcentralhigh
Manual read (M)8,50026,50090,000
Schema call (F)1,4001,5001,900
Saved (Δ)7,10025,00088,100
Reduction6.1×17.7×47.4×

The schema is not free to build, so when does it pay off? Break-even is the build cost divided by the saving per call. For a single developer, the schema is in the plus after about 7 tool-calls (4 to 10 across the range). Shared across everyone who uses it, break-even drops to about 1 call.

What the build actually cost

The full corpus of 518 schemas came to about $5,746 at one model’s metered rates at the time of measurement. Two line items drove it: cache reads at $3,370 and output at $899. A cheaper model cuts that hard, to about $1,149 on the small model or $3,448 on the mid one. The honest caveat: weaker models tend to need more rounds. Either way, the build is paid once and spreads over every later caller.

The structure behind the low ongoing cost is a trust asymmetry. You trust the execution engine once, which is the large decision. After that each schema is small and cheap to check, so adding more stays cheap. A full quality grade of a namespace runs about 132,626 tokens and can be delegated. A quick security read of a single schema file is an estimated 17,000 tokens, roughly 8× cheaper. I still want to confirm that last figure against a real file.

The bigger cost is quality, not tokens

The token bill is the visible cost. The hidden one is decision quality.

Raw HTML and JSON poured into context is pollution: the wrong kind of tokens. And more tokens measurably degrade output. Chroma’s “Context Rot” study found non-linear degradation across 18 models as input grows. The NoLiMa benchmark saw 11 of 13 models fall below 50% at 32,000 tokens. “Lost in the Middle” showed models miss facts placed mid-context. A single distractor lowers performance.

So a bloated first read is not just more expensive. It makes the next decision worse, which causes retries, which cost more again. A structured schema hands the agent a small, high-signal payload and skips that loop.

The CO2 line, honestly bounded

Tokens map to energy, and energy to CO2. The honest framing comes first: model inference energy is not published, so every figure here is a range, not a point.

Per first-read call, the saving is about 0.47 to 1.64 to 5.78 grams of CO2. Across the whole 518-schema corpus, the one-time build footprint is 20.6 to 68.21 to 535.67 kg, a 26× spread. For scale: 244 grams is roughly one kilometre by car, and 12.4 grams is one smartphone charge (EPA figures).

Where to start

Point an agent at a served catalog instead of the open web. The Berlin open-data set I measured is 47 namespaces and 293 tools, about 6.2 tools per namespace, behind one search-then-call interface. FlowMCP is the open-source implementation I used (github.com/FlowMCP), and because each schema file is small, you can read one before you trust it. Pick one data source your agent hits often, measure the before and after in tokens, and let the roughly 7-call break-even make the decision for you.

Related Posts

hackathon

Making the Connection — How FlowMCP Became a Mobility Framework

Story from DB InfraGO's 'Anschluss erreichen' hackathon, where FlowMCP's main contributor reached 3rd place with a multi-agent mobility assistant.

release

FlowMCP v4.2 — Grading as a Versioned Standard

FlowMCP Spec v4.2 delegates schema grading to its own independently versioned standard — the Grading-Spec v2.0, published as its own docs area so anyone can grade by the same rules.

release

FlowMCP v4.0 — Skills, Selections, Pipes

How deterministic structures carry LLM composition without the AI hallucinating parameters.