Skip to main content
Glama

Block by number or tag

getBlock
Read-only

Fetch a blockchain block by hash, number, or tag on Ankr-supported chains and Sui, with optional decoded transactions.

Instructions

Get a block by a 0x-64 hash, a block number (decimal or 0x-hex), or a tag (latest, finalized, safe, earliest, pending). Tier 2 drops the verbose header roots and bloom and, with includeTxs, ABI-decodes and compacts the embedded transactions. A large block with includeTxs may come back raw (hex); _meta.tier says which, and dropping includeTxs gets the header decoded. Sui: block is a checkpoint number or digest.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blockYesBlock number (decimal or 0x-hex), a 0x-64 block hash, or a tag. Above 2^53 pass a STRING — a JSON number that large is not exact.
chainYesChain slug as in rpc.ankr.com/<chain> — any chain Ankr serves (see listChains)
includeTxsNoInclude full (decoded) transactions instead of just hashes (default false)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior5/5

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

Annotations only supply readOnlyHint and openWorldHint, so the description carries the behavioral burden and does so well: it discloses tier behavior (header roots/bloom dropped), ABI-decoded and compacted transactions, and the important fallback that a large includeTxs block may return raw hex with _meta.tier indicating which. The Sui checkpoint caveat adds chain-specific semantics. This is rich context beyond the structured fields.

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

Conciseness4/5

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

Front-loaded with the core purpose and the accepted input forms, then layered with tier and Sui details. Each sentence carries information, though the middle sentence is dense and run-on. Nothing is wasted.

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?

With no output schema, the description rightly covers return-format variability (_meta.tier, raw-hex vs decoded header), which is exactly what an agent needs before calling. Parameter and chain nuances are addressed. Only minor gaps remain around broader response shape.

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 3 baseline applies, but the description adds real meaning: it explains what includeTxs actually does to the payload (decoding, compaction, raw-hex fallback) rather than just restating 'include full transactions'. The block-format guidance largely overlaps the schema description, keeping this from a 5.

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

Purpose4/5

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

States a specific verb and resource ('Get a block') and enumerates the three accepted input forms (0x-64 hash, decimal/0x-hex number, or tag). An agent can immediately tell this fetches a block rather than a transaction, even without an explicit sibling contrast. It stops short of naming which sibling to prefer in ambiguous cases.

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

Usage Guidelines3/5

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

Gives conditional guidance tied to parameters — 'with includeTxs, ABI-decodes and compacts' and 'dropping includeTxs gets the header decoded' — which helps the agent choose. However it never states when to reach for this tool versus getTransaction or rpcCall, so usage is implied rather than directed.

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