Skip to main content
Glama
romudille-bit

AgentPay x402 — Economic-intelligence layer for AI Agents

dune_query

Read-onlyIdempotent

Run a Dune Analytics query by ID to return live onchain rows for protocol revenue, user counts, or custom metrics. Set fast_only=True to get cached results or fail immediately.

Instructions

Run any Dune Analytics query and return live onchain results by query ID. Use fast_only=True for live bots — returns cached result instantly or raises immediately, never blocks.

Use when: You need deep onchain analytics from a specific Dune query — protocol revenue, user counts, custom metrics. Not for: you have no Dune query ID — the other tools cover prices, derivatives, TVL and security without one; you need sub-second answers — set fast_only=true or use a cached tool. Returns: rows[], columns[], row_count, generated_at from the Dune Analytics query result Example response: {"query_id": 3810512, "row_count": 2, "columns": ["protocol", "revenue_usd"], "rows": [{"protocol": "Uniswap V3", "revenue_usd": 1243800.0}, {"protocol": "Aave V3", "revenue_usd": 987200.0}], "generated_at": "2026-03-22T00:00:00Z", "source": "dune"}

Price: free. Read-only live public data; no API key, nothing signed or spent. Fails with an error message on an unknown symbol or an unreachable upstream source.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum rows to return (default 25)
query_idYesDune Analytics query ID (visible in the query URL)
fast_onlyNoIf True, return cached result immediately or raise — never execute a fresh query. Use for live bots where latency matters. Default: False.
query_parametersNoOptional named parameters to pass to the Dune query

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.2
    • addedInput schema / properties / fast_only
      Added value: +{
      +  "default": false,
      +  "description": "If True, return cached result immediately or raise — never execute a fresh query. Use for live bots where latency matters. Default: False.",
      +  "type": "boolean"
      +}
  2. Addedv0.3.1
  3. Removedv0.3.0
  4. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover the safety profile (readOnly, openWorld, idempotent, non-destructive), yet the description adds real value beyond them: fast_only semantics ('returns cached result instantly or raises immediately, never blocks'), cost ('free, no API key, nothing signed or spent'), and failure modes ('fails with an error message on an unknown symbol or unreachable upstream source').

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core purpose, then cleanly sectioned into Use when / Not for / Returns. The example response is long but earns its place because there is no output schema to convey the return shape.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description compensates by specifying the return fields (rows[], columns[], row_count, generated_at) and a full example response. Nested query_parameters and all four params are covered, and cost/auth/failure behavior is stated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the schema documents all four parameters, giving a baseline of 3. The description still adds meaning beyond the schema by explaining the latency/blocking contract of fast_only and its intended audience ('for live bots').

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Specific verb (Run) plus resource (Dune Analytics query) scoped to a query ID, and it explicitly routes away from siblings ('the other tools cover prices, derivatives, TVL and security without one'). An agent can distinguish it from defi_tvl, token_price, etc. without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit 'Use when' and 'Not for' sections name the exact preconditions (you need a Dune query ID) and the disqualifiers (no query ID, need sub-second answers). It even redirects to the correct fallback ('set fast_only=true or use a cached tool').

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.