Skip to main content
Glama

eth_getBlockByHash

Retrieve detailed block information by its hash, including transactions, gas used, and timestamp. Optionally return full transaction objects.

Instructions

Get detailed block information using its hash.

Args:

  • blockHash (string): 32-byte block hash (66 chars with 0x prefix).

  • fullTransactions (boolean): If true, returns full tx objects; if false, returns tx hashes only.

  • network (string, optional): Ethereum network to query. Defaults to 'mainnet'.

Returns:

  • Block object with number, hash, parentHash, transactions, gasUsed, timestamp, etc. Returns null if block not found.

Examples:

  • "Get block with tx hashes": { "blockHash": "0x...", "fullTransactions": false }

  • "Get block with full txs": { "blockHash": "0x...", "fullTransactions": true, "network": "mainnet" }

Errors:

  • InvalidParams: When blockHash format is invalid (not 66 char hex).

  • InternalError: When Infura API is unavailable or returns an error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blockHashYesThe 32-byte hash of the block to retrieve.
fullTransactionsNoIf true, returns full transaction objects; if false, returns transaction hashes.
networkNoThe Ethereum network to query, e.g., 'mainnet' or 'sepolia'.mainnet
response_formatNoOutput format: 'json' for structured data, 'markdown' for human-readable.json
Behavior4/5

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

With no annotations, the description reveals error types (InvalidParams, InternalError) and the return of null for missing blocks, though it lacks details on rate limits or authentication.

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?

The description is well-organized with clear sections (Args, Returns, Examples, Errors), using concise language without wasting words.

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?

Despite lacking an output schema, the description lists key return fields and error conditions, giving the agent a complete understanding of the tool's behavior and output.

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 covers all parameters (100%), and the description adds value by specifying blockHash format (66 chars with 0x prefix), clarifying fullTransactions behavior, and providing examples. It omits response_format but is still helpful.

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?

The description clearly states the tool retrieves detailed block information using a block hash, distinguishing it from the sibling tool eth_getBlockByNumber which uses block number.

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?

The description provides examples and clarifies parameter options, but does not explicitly state when to use this tool over alternatives like eth_getBlockByNumber.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Qbandev/infura-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server