Skip to main content
Glama

eth_getTransactionByBlockHashAndIndex

Retrieve a specific transaction from a block using its block hash and transaction index position. Returns transaction details like hash, value, gas, and more.

Instructions

Get a transaction by its position within a block identified by hash.

Args:

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

  • index (string): Transaction index position as hex (e.g., '0x0' for first tx).

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

Returns:

  • Transaction object with hash, from, to, value, gas, gasPrice, input, nonce, etc. Returns null if not found.

Examples:

  • "Get first tx in block": { "blockHash": "0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238", "index": "0x0" }

  • "Get third tx on Sepolia": { "blockHash": "0x...", "index": "0x2", "network": "sepolia" }

Errors:

  • InvalidParams: When blockHash or index format is invalid.

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blockHashYesThe 32-byte hash of the block.
indexYesThe transaction index position.
networkNoThe Ethereum network to query, e.g., 'mainnet' or 'sepolia'.mainnet
response_formatNoOutput format: 'json' for structured data, 'markdown' for human-readable.json
Behavior3/5

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

With no annotations, the description carries full burden. It mentions returns null if not found, lists possible errors, and notes that network defaults to mainnet. Missing details on rate limits, authentication, or destructive actions, but adequate for a read-only lookup tool.

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

Conciseness4/5

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

Well-organized with sections for args, returns, examples, errors. Could be slightly more concise, but every sentence adds value. Front-loaded with the core purpose.

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 4 parameters and no output schema, the description covers input format, defaults, return structure, null case, error conditions, and provides two examples. No obvious gaps for this straightforward lookup tool.

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 coverage is 100%, so baseline 3. The description adds format details (66 chars, 0x prefix) and default value for network, but fails to mention the response_format parameter present in the schema. Partial added value offset by omission.

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 it retrieves a transaction by its position in a block identified by hash. It distinguishes from sibling tools like eth_getTransactionByHash and eth_getTransactionByBlockNumberAndIndex, which use different lookup methods.

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?

Provides examples and explains the required input structure. Does not explicitly state when not to use or compare to alternatives, but the context and sibling list imply differentiation. Good practical guidance via examples.

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