Skip to main content
Glama

eth_getBlockByNumber

Get Ethereum block details by block number or tag, including transactions, gas used, and timestamp. Works on multiple networks.

Instructions

Get detailed block information using its number or tag.

Args:

  • blockNumber (string): Block number as hex (e.g., '0x10d4f') or tag ('latest', 'earliest', 'pending').

  • 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 latest block": { "blockNumber": "latest", "fullTransactions": false }

  • "Get specific block with full txs": { "blockNumber": "0x10d4f", "fullTransactions": true }

Errors:

  • InvalidParams: When blockNumber format is invalid.

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blockNumberYesThe block number in hexadecimal format or one of the string tags `latest`, `earliest`, or `pending`.
fullTransactionsNoIf true, returns the full transaction objects; if false, returns only the hashes of the transactions.
networkNoThe Ethereum network to query, e.g., 'mainnet' or 'sepolia'.mainnet
response_formatNoOutput format: 'json' for structured data, 'markdown' for human-readable.json
Behavior5/5

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

No annotations exist, so the description fully covers behavior: it describes the return value (Block object or null), specific error types (InvalidParams, InternalError), and includes examples. It makes the tool's read-only, safe nature clear.

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 Args, Returns, Examples, and Errors sections. Every sentence provides necessary information without redundancy. It is appropriately sized for the tool's complexity.

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?

Given no output schema, the description explains the return object (including field examples) and null case. It also covers error conditions and provides concrete examples, making it complete for an agent to use effectively.

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 is 3. The description adds value by explaining blockNumber accepts hex or tags, fullTransactions boolean, and network defaults to mainnet. However, it omits the response_format parameter, though it does describe return format elsewhere. Examples and error info further enhance understanding.

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 'Get detailed block information using its number or tag,' which is a specific verb and resource. It distinguishes from siblings like eth_getBlockByHash (block by hash) and eth_getBlockNumber (just the 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 clear context for when to use this tool, with examples demonstrating typical usage. However, it does not explicitly state when not to use it or compare to alternatives, leaving some implicit guidance.

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