Skip to main content
Glama

eth_getBlockTransactionCountByHash

Retrieve the count of transactions in an Ethereum block using its hash. Supports multiple networks like mainnet and sepolia.

Instructions

Get the number of transactions in a block identified by its hash.

Args:

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

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

Returns:

  • Hexadecimal string representing transaction count (e.g., '0x10' for 16 transactions). Returns null if block not found.

Examples:

  • "Count txs in block": { "blockHash": "0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238" }

  • "Query Sepolia block": { "blockHash": "0x...", "network": "sepolia" }

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 block hash to query.
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?

No annotations are provided, so the description carries the full burden. It explains the return value (hex string, null if block not found), lists possible errors (InvalidParams, InternalError), and gives examples. It does not detail auth or rate limits, but for a read-only blockchain query this is sufficient.

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 sections for Args, Returns, Examples, and Errors. Every sentence adds value, and there is no redundant or extraneous text.

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 simple block transaction count tool with 3 parameters and no output schema, the description fully covers purpose, all parameters, return format, error conditions, and usage examples. It is complete enough for correct invocation.

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%, providing baseline of 3. The description adds value by specifying blockHash format (66 chars with 0x prefix) and network default. However, it omits the response_format parameter present in the schema, missing the chance to explain its options (json/markdown).

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 gets the number of transactions in a block by its hash. It is distinct from sibling tools like eth_getBlockTransactionCountByNumber (which uses block number) and eth_getTransactionCount (which counts transactions for an address).

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 includes examples showing typical usage and optional network parameter, making it clear when to use. However, it does not explicitly state when not to use or suggest alternatives among the many siblings.

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