Skip to main content
Glama

evm_get_block

Retrieve detailed EVM block data by block number, hash, or keyword, including transactions, gas usage, miner, and timestamps for chain analysis and monitoring.

Instructions

Get detailed block information including transactions, gas usage, miner, and timestamps.

Retrieves comprehensive block data from any EVM chain. Supports querying by block number, block hash, or special keywords like "latest", "earliest", "pending".

CRITICAL RULES:

  • Block numbers can be decimal (12345) or hex (0x3039)

  • Block hashes are 0x-prefixed 32-byte hex strings (66 characters)

  • "latest" returns most recent mined block

  • Returns transaction hashes by default (not full transaction objects)

PARAMETERS:

  • chain: EVM chain to query (required)

    • Block numbers are chain-specific

    • Different chains have different block times

  • blockNumberOrHash: Block identifier (required)

    • Block number: "12345" or "0x3039"

    • Block hash: "0x1234...abcd" (66 characters)

    • Keywords: "latest", "earliest", "pending"

EXAMPLES: ✅ Get latest block: {chain: "polygon", blockNumberOrHash: "latest"}

✅ Get specific block by number: {chain: "ethereum", blockNumberOrHash: "5000000"}

✅ Get block by hash: {chain: "arbitrum", blockNumberOrHash: "0xabcd1234..."}

❌ Invalid - wrong keyword: {chain: "polygon", blockNumberOrHash: "newest"}

❌ Invalid - negative block number: {chain: "bsc", blockNumberOrHash: "-1"}

SUPPORTED EVM CHAINS (7 networks): • ethereum (Sepolia) - EIP-1559 enabled, ~12s blocks, moderate gas costs • polygon (Amoy) - Low fees, fast finality (~2s), layer 2 • avalanche (Fuji C-Chain) - Sub-second finality, dynamic fees • bsc (BNB Testnet) - 3s blocks, low gas costs, Binance ecosystem • arbitrum (Sepolia) - Optimistic rollup, low fees, Ethereum security • base (Sepolia) - Coinbase layer 2, EIP-1559, low fees • worldchain (World Sepolia) - World Network testnet, EIP-1559

CRITICAL GAS CONSIDERATIONS:

  • Ethereum: High gas costs, use gas oracle for timing

  • Polygon/BSC: Very low gas, safe for frequent transactions

  • Arbitrum/Base: L2 optimizations, ~10-50x cheaper than Ethereum

  • Avalanche: Dynamic fees, can spike during congestion

  • Always check gas price before executing transactions

TESTNET TOKENS: All chains use testnet tokens with NO REAL VALUE. Faucets available for all supported networks.

OUTPUT STRUCTURE: • success: Boolean indicating operation success • block: Object with block details

  • number: Block number

  • hash: Block hash

  • parentHash: Previous block hash

  • timestamp: Unix timestamp

  • miner/coinbase: Block producer address

  • gasUsed: Total gas used in block

  • gasLimit: Block gas limit

  • baseFeePerGas: EIP-1559 base fee (if applicable)

  • transactions: Array of transaction hashes

  • transactionCount: Number of transactions

  • difficulty: Mining difficulty (PoW chains) • executionTime: Time taken in milliseconds

COMMON MISTAKES:

  • Fetching blocks too fast (respect RPC rate limits)

  • Not handling reorgs (blocks can become orphaned)

  • Assuming "latest" is finalized (may be reorganized)

  • Comparing block timestamps across chains (different block times)

USE CASES:

  • Monitor blockchain state and height

  • Calculate average gas usage per block

  • Track block production times

  • Analyze transaction throughput

  • Detect block reorganizations

Running on Linux.

LINUX-SPECIFIC NOTES:

  • Package manager: apt (Ubuntu/Debian), yum (RHEL/CentOS), or pacman (Arch)

  • Python 3 is typically 'python3' command

  • GNU tools are standard

  • Use 'xdg-open' command to open files/applications

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "chain": "<chain>",
      "blockNumberOrHash": "<blockNumberOrHash>"
    },
    "name": "evm_get_block"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainYesEVM chain to query
blockNumberOrHashYesBlock number, hash, or "latest"/"earliest"/"pending"

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so substantively: it discloses that transaction hashes (not full objects) are returned by default, warns about RPC rate limits, block reorgs/orphaning, and that "latest" is not finalized. The OUTPUT STRUCTURE section compensates for the missing output schema. It loses a point for extraneous, partly misleading material (gas-price advice about "executing transactions") that has no bearing on a read-only block fetch.

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

Conciseness2/5

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

The core is front-loaded and clear, but the definition is heavily padded with content irrelevant to this tool: per-chain marketing blurbs, blocks of CRITICAL GAS CONSIDERATIONS, testnet faucet notes, and OS-level Linux/package-manager instructions. These sections dilute the signal an agent needs and add no calling information.

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?

For a two-parameter read tool with no output schema, this covers everything: accepted identifier syntax, valid chain enum, an explicit output field listing, edge cases around reorgs and "latest", and worked valid/invalid examples. Nothing needed to invoke the tool correctly is missing.

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 baseline would be 3, and the description earns above that by adding accepted formats not in the schema: decimal vs 0x-hex numbers, 66-character hash shape, the three keyword values, plus valid and invalid examples. Chain-specific note (block numbers are chain-specific) is a useful semantic addition the enum does not convey.

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?

Opens with a specific verb and resource: "Get detailed block information including transactions, gas usage, miner, and timestamps." The scope (full block data, tx hashes by default) distinguishes it from narrow siblings like evm_get_block_number or evm_get_block_gas_limit, though it never names those siblings explicitly.

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?

Usage is implied rather than prescribed: a USE CASES list (monitor chain height, gas per block, throughput) and COMMON MISTAKES give context, and the accepted identifier formats are spelled out. However, there is no explicit statement of when to prefer this over sibling tools such as evm_get_block_number or evm_get_block_gas_limit, so an agent must infer the boundary from the name alone.

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

Deploy Server

Other Tools