Skip to main content
Glama

eth_getBlockNumber

Fetch the current block number of an Ethereum network via Infura. Defaults to mainnet, supports networks like Sepolia.

Instructions

Fetch the latest block number from an Ethereum network.

Args:

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

Returns:

  • Hexadecimal string representing the current block number (e.g., '0x10d4f').

Examples:

  • "Get mainnet block number": {}

  • "Get Sepolia block number": { "network": "sepolia" }

Errors:

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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?

The description fully discloses the tool's behavior: it queries an Ethereum network, returns a hexadecimal string, and can raise InternalError if the Infura API fails. It also explains the default network. Since no annotations are provided, the description carries the full burden and does so thoroughly.

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-structured with sections for description, args, returns, examples, and errors. It is concise with no redundant sentences, making it easy to parse.

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 explains the return value (hex string) and covers errors. Both parameters are documented in the schema, and the description adds context for network. For a simple tool, this is complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds value for the network parameter by explaining its usage and providing examples. However, it does not mention response_format, which is covered in the schema. Overall, it meets the baseline.

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 explicitly states 'Fetch the latest block number from an Ethereum network', which is a specific verb+resource. It clearly distinguishes from sibling tools like eth_getBlockByNumber or eth_getBlockByHash, which fetch full block data.

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 notes the optional network parameter with a default. While it doesn't explicitly exclude siblings, the purpose is clear, and the context is sufficient for an agent to decide when to use this tool.

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