Your agent needs to know "how many wallets minted on Base in the last 24 hours." The naive approach: scrape the block explorer, dump a JSON blob into the prompt, ask the model to count. The smart approach: call a tool, pay a fraction of a cent, get a structured answer back. This whole article is about the second path — and specifically about how we built EVIDIQ Atlas to make it boring and cheap.
Querying Datasets From an AI Agent, Defined
To query datasets from AI agents means the agent sends a structured call — typically over MCP/JSON-RPC — to a data service, receives a focused response (a slice, summary, or computed metric), and returns the answer to the user without ever loading the raw data into the prompt. EVIDIQ Atlas is the pay-per-call implementation of this pattern at EVIDIQ, exposed as a tool in our MCP server.
Stripped down, the contract is one sentence. The agent never sees the rows; it sees the answer. The user never sees the bill until after the call succeeded. And the data provider gets paid per request, settled via the x402 scheme we use everywhere at EVIDIQ.
In practice, an Atlas call looks like three JSON-RPC messages: estimate_cost, then query_dataset, then optionally compare_datasets. Each one returns a deterministic, schema-validated payload — never a freeform blob. That's the part most teams get wrong when they roll their own "tool calling" layer. As soon as the model gets to interpret raw output, you reintroduce the same hallucination surface you were trying to avoid by calling a tool in the first place.
The Context-Window Tax Nobody Budgets For
[IMAGE_PROMPT: A modern flat illustration showing a developer's desk with a laptop displaying a JSON-RPC tool call panel and an MCP server icon, a stylized payment-challenge card floating toward the screen with a tiny USDT0 token beside it, and a small bar chart emerging from the laptop — clean developer/tech aesthetic, soft blue and orange gradient palette, no text overlay, no real brand logos]
Here is the math nobody budgets for. A typical block-explorer dump of "Base mints, last 24h" is 50–200 KB of JSON. Tokenized, that's roughly 12,000–50,000 tokens. At Claude- or GPT-class pricing in 2026, that runs $0.30 to $1.20 just to read the data — before the model has produced a single word of answer.
But the visible cost is the smallest line on the invoice. The bigger ones:
- Latency. Every extra 10K tokens adds 1–3 seconds of prefill on top of the time the user is already waiting. A 50K-token context dump is the difference between "feels real-time" and "user opens another tab."
- Accuracy loss. Long contexts degrade. Models forget middle-of-context instructions, paraphrase values they were told to copy verbatim, and silently drop fields they consider "redundant." The retrieval-augmented-generation literature has been screaming about this for three years; somehow the practice hasn't caught up.
- Retrieval hygiene. When you stuff raw data into the prompt, you also stuff in PII, internal IDs, and any bias the dataset carries. Once it's in the context, it's in the conversation — and in any log you keep.
The opinionated take: context-dumping is the wrong default. It was a 2026 hack that survived because tool calling was immature. In 2026, an agent that can't decide which slice of a dataset it needs is an agent that hasn't been built yet. Every time an agent needs to query datasets from AI agents, the call should be a function with a price, a budget, and a typed return.
Our Atlas probe is built around that principle. The server exposes narrow, typed endpoints — query_dataset(dataset_id, filters, fields, group_by, limit) — and refuses freeform blob returns. If your agent wants 50K tokens of rows, it has to ask for them explicitly, and the cost is computed and shown before the call settles. We think that's how it should have always worked.
One Question, One Priced Call
Walk a real flow. Your agent receives: "Compare the on-chain volume of USDT0 on X Layer vs USDC on Base over the last seven days."
This is the trace, end to end:
- Agent calls
estimate_cost({query: "volume_7d", datasets: ["usdt0_xlayer","usdc_base"]}). Free. Returns something like{usd_micro: 4500, calls: 2, est_latency_ms: 1200}. The agent — or the orchestrating planner — decides whether to proceed. - If yes, the agent issues
query_dataset(...)twice. Each call hits the 402 challenge from EVIDIQ's x402 server:HTTP 402 Payment Required, body{"accepts":[{"scheme":"exact","network":"x-layer","asset":"USDT0","amount":"2250","payTo":"0x..."}]}. The agent's wallet signs anEIP-3009 transferWithAuthorizationfor 2,250 µUSDT, retries, and gets a 200. - The agent calls
compare_datasets({left: "usdt0_xlayer", right: "usdc_base", metric: "volume_7d", window: "7d"}). Same flow. Returns an artifact:{left_value: 12345678, right_value: 9876543, delta_pct: 25.0, series: [...], evidence_uri: "https://.../report.json", hash: "keccak256:..."}. - The agent pastes the structured result — not the raw series — into the final user-facing answer. The user sees a clean comparison; the wallet signs a few µUSDT; everyone is happy.
Once an agent has learned this pattern, it never goes back to context-dumping. It's the cleanest way we know to query datasets from AI agents in production.
The returned artifact has fields worth knowing:
left_value/right_value— typed numerics, not strings.series— optional pre-aggregated chart data, included only if the agent asked forinclude_series: true. If the agent didn't, the series stays server-side and the prompt stays small.evidence_uri— pointer to the canonical report on 0G Storage.hash— keccak256 of the canonical report. Anyone can re-fetch, re-hash, and verify.
Notice what's not in the artifact: the raw row dump. That's deliberate. The whole point of having a typed query layer is that the model gets the answer, not the warehouse.
Where Atlas Fits Next to Sentinel and Notary
[IMAGE_PROMPT: A modern flat illustration of three connected modules arranged around a central MCP server hub — one labeled abstractly as TRUST (shield icon), one as ANALYZE (bar chart icon), one as RECEIPT (document icon) — with a small x402 payment token flowing through the connection lines, a tiny agent character on the left handing off a query, soft gradient palette of teal, indigo, and amber, no real brand logos, no text overlay, clean developer aesthetic]
Atlas is one tool in a family. We built the EVIDIQ MCP server so that a single agent can chain trust, analysis, and receipt in one session, paid the same way every time.
The siblings:
- Sentinel answers "should I trust this agent before I transact with it?" — the
verify_agentcall returns a 0–100 trust score plus a proceed/caution/escrow/do_not_proceed recommendation. See the EVIDIQ Sentinel docs for the full scoring formula. - Atlas answers "what does the data say?" —
query_datasetandcompare_datasetsreturn focused, priced answers about on-chain and off-chain datasets. - Notary answers "can I prove what the model just produced?" — wraps an output, hashes it, anchors the evidence on 0G Storage, and signs the verdict with the EVIDIQ key (EIP-191). Full flow in the EVIDIQ Notary docs.
- Operator is the runtime that wires all of this into a single agent loop — installing the skill, holding the x402 wallet, retrying on payment failure, and emitting a unified audit trail. Start with the EVIDIQ Operator docs.
Across all three, the pattern holds: every EVIDIQ tool call returns a deterministic, signed, hashable artifact. Every call is metered via x402 on X Layer, in USDT0. Every report has an evidence URI you can re-fetch and verify yourself. Operators use the same primitive regardless of whether they're scanning a counterparty, query datasets from AI agents, or sealing an output — which is exactly why we built them as siblings instead of as one mega-API. Want the schema reference? It's at EVIDIQ docs.
What we deliberately didn't ship is any write-side tool. Atlas has no write_dataset or mutate_* calls, because every read returns an evidence URI but every write would have to return a settlement receipt — and that's a different product with different liabilities. Atlas tells you what's in the world; Sentinel tells you whether to believe the actor; Notary tells you whether to believe the output. Three legs, one trust stool.