Skip to main content
Glama

onchain_query

PRIMARY tool for indexed on-chain stats/activity/totals — prefer this over raw RPC for chain data. Each op is a backend-agnostic intent: the query gateway selects the most accurate live source per field (indexed DB / pre-aggregated metrics / Data API), stamps every field (sources), and flags any caveat (warnings) — relay warnings to the user, never present a flagged value as exact. Pick an op and pass its params; chainId is an allowlisted EVM chain (43114 C-Chain, 43113 Fuji, + L1s). Lookback: hour-based ops (chainStatsRecent/chainActivity/addressActivity) max 720h (30 days); day-based ops (chainStatsSeries/contractStats/chainGasTotal/protocolRanking/contractGasFlow/topUnknownContracts) max 365 days — use a day-based op for windows over 30 days. Ops: chainStatsRecent {chainId, hours≤720} — tx count/gas/fees/active senders/avg gas price over the last N hours; chainStatsSeries {chainId, days≤365, bucket: hour|day|week|month} — bucketed time-series of the same; addressActivity {chainId, address, hours≤720, limit≤100} — tx count + recent sample for an address in a window; chainActivity {chainId, hours≤720, limit≤100} — tx count + recent sample chain-wide in a window; contractStats {chainId, contract, days≤365} — tx/unique-sender/gas totals for a contract; protocolRanking {chainId, contracts[≤25], days≤365, orderBy: txCount|gasUsed|uniqueSenders|feesPaidAvax, dir: asc|desc, limit≤100} — rank a set of contracts; contractGasFlow {chainId, contract, days≤365, limit≤100} — gas received/given per counterparty; topUnknownContracts {chainId, exclude[≤25], days≤365, limit≤100} — top contracts by gas excluding a set; chainGasTotal {chainId, days≤365} OR {chainId, fromDate, toDate} — total tx/gas/fees over N days or a YYYY-MM-DD range (≤365d). Note: C-Chain gasUsed is gas-target-regulated → ~stable day-to-day even as txCount varies (expected, not a bug).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
opYesThe query operation
paramsYesOp-specific parameters (see description); validated server-side.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description discloses behavior: each op selects live sources, stamps sources, flags caveats, and requires relaying warnings. Also notes C-Chain gasUsed regulation. This goes beyond basic read/write expectations.

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

Conciseness3/5

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

Description is comprehensive but verbose; while well-structured with front-loaded purpose, it could be more concise given the length. Earns its detail but not a model of brevity.

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

Completeness4/5

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

Complex tool with 9 ops; description covers all ops, parameters, lookback limits, and behavioral quirks. No output schema, but mentions return fields (sources, warnings). Complete enough for effective use.

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% but schema provides only minimal descriptions. The description compensates by detailing each op's parameters thoroughly, adding meaning beyond the schema's enum and nested object.

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?

Description clearly identifies as 'PRIMARY tool for indexed on-chain stats/activity/totals' and specifies it should be preferred over raw RPC, making the purpose and resource unambiguous.

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

Usage Guidelines4/5

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

Explicitly guides to prefer this over raw RPC, provides lookback limits, and explains when to use day-based vs hour-based ops. However, it does not explicitly differentiate from sibling tools like chain_stats or onchain_activity.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.