Skip to main content
Glama

get_transaction_receipt

Retrieve detailed transaction receipt information using its hash. Specify the network or use the default Ethereum mainnet. Works with EVM-compatible blockchains via a unified interface.

Instructions

Get a transaction receipt by its hash

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
networkNoNetwork name or chain ID. Defaults to Ethereum mainnet.
txHashYesThe transaction hash to look up

Implementation Reference

  • Core handler function that fetches the transaction receipt by hash using viem's public client for the specified EVM network.
    export async function getTransactionReceipt(hash: Hash, network = 'ethereum'): Promise<TransactionReceipt> { const client = getPublicClient(network); return await client.getTransactionReceipt({ hash }); }
  • MCP tool registration for 'get_transaction_receipt', including inline Zod input schema, description, and wrapper handler that delegates to the core service function and handles response formatting and errors.
    // 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 }; } } );
  • Zod input schema for the get_transaction_receipt tool: requires txHash (string), optional network (string).
    { txHash: z.string().describe('The transaction hash to look up'), network: z .string() .optional() .describe('Network name or chain ID. Defaults to Ethereum mainnet.')
  • The registerEVMTools function that registers all EVM tools including get_transaction_receipt.
    export function registerEVMTools(server: McpServer) {
  • Re-export of transactions service functions including getTransactionReceipt in services index.
    export * from './transactions.js'; export * from './contracts.js';

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