Skip to main content
Glama

get_transaction_receipt

Read-onlyIdempotent

Retrieve transaction confirmation status, gas usage details, and event logs from EVM-compatible blockchains to verify transaction completion.

Instructions

Get transaction receipt (confirmation status, gas used, logs). Use this to check if a transaction has been confirmed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
txHashYesTransaction hash (0x...)
networkNoNetwork name or chain ID. Defaults to Ethereum mainnet.

Implementation Reference

  • MCP tool handler: fetches transaction receipt via service, formats as JSON text content, handles errors with isError flag.
    async ({ txHash, network = 'ethereum' }) => {
      try {
        const receipt = await services.getTransactionReceipt(
          txHash as Hash,
          network
        );
    
        return {
          content: [
            {
              type: 'text',
              text: services.helpers.formatJson(receipt)
            }
          ]
        };
      } catch (error) {
        return {
          content: [
            {
              type: 'text',
              text: `Error fetching transaction receipt ${txHash}: ${error instanceof Error ? error.message : String(error)}`
            }
          ],
          isError: true
        };
      }
    }
  • Zod input schema: txHash (string, required), network (string, optional).
    {
      txHash: z.string().describe('The transaction hash to look up'),
      network: z
        .string()
        .optional()
        .describe('Network name or chain ID. Defaults to Ethereum mainnet.')
  • Tool registration via server.tool call in registerEVMTools, including name, description, schema, and handler.
    // Get transaction receipt
    server.tool(
      'get_transaction_receipt',
      'Get a transaction receipt by its hash',
      {
        txHash: z.string().describe('The transaction hash to look up'),
        network: z
          .string()
          .optional()
          .describe('Network name or chain ID. Defaults to Ethereum mainnet.')
      },
      async ({ txHash, network = 'ethereum' }) => {
        try {
          const receipt = await services.getTransactionReceipt(
            txHash as Hash,
            network
          );
    
          return {
            content: [
              {
                type: 'text',
                text: services.helpers.formatJson(receipt)
              }
            ]
          };
        } catch (error) {
          return {
            content: [
              {
                type: 'text',
                text: `Error fetching transaction receipt ${txHash}: ${error instanceof Error ? error.message : String(error)}`
              }
            ],
            isError: true
          };
        }
      }
    );
  • Underlying service function that uses viem's public client to fetch the transaction receipt from the blockchain.
    export async function getTransactionReceipt(hash: Hash, network = 'ethereum'): Promise<TransactionReceipt> {
      const client = getPublicClient(network);
      return await client.getTransactionReceipt({ hash });
    }
Behavior4/5

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

The description adds valuable context beyond what annotations provide. While annotations indicate read-only, open-world, idempotent, and non-destructive behavior, the description clarifies the specific purpose ('check if a transaction has been confirmed') and what data is returned ('confirmation status, gas used, logs'). This helps the agent understand the tool's functional scope.

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 perfectly concise with two sentences that each serve distinct purposes: the first defines what the tool does, and the second provides usage guidance. There's no wasted language, and the most important information is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the comprehensive annotations (readOnlyHint, openWorldHint, idempotentHint, destructiveHint) and full parameter documentation in the schema, the description provides adequate context. However, without an output schema, the description could benefit from more detail about the return format, though the mention of specific data elements ('confirmation status, gas used, logs') partially addresses this.

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?

With 100% schema description coverage, the input schema already fully documents both parameters (txHash and network). The description doesn't add any parameter-specific information beyond what's in the schema, so it meets the baseline expectation without providing additional semantic context.

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 specific action ('Get transaction receipt') and resource ('transaction'), with explicit details about what information is retrieved ('confirmation status, gas used, logs'). It distinguishes from sibling tools like 'get_transaction' by focusing on receipt-specific data rather than transaction details.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool: 'Use this to check if a transaction has been confirmed.' This clearly differentiates it from alternatives like 'get_transaction' (which might show pending transactions) and 'wait_for_transaction' (which actively waits for confirmation).

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/chulanpro5/evm-mcp-server'

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