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
| Name | Required | Description | Default |
|---|---|---|---|
| network | No | Network name or chain ID. Defaults to Ethereum mainnet. | |
| txHash | Yes | The transaction hash to look up |
Implementation Reference
- src/core/services/transactions.ts:20-23 (handler)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 }); }
- src/core/tools.ts:475-513 (registration)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 }; } } );
- src/core/tools.ts:479-484 (schema)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.')
- src/core/tools.ts:25-25 (registration)The registerEVMTools function that registers all EVM tools including get_transaction_receipt.export function registerEVMTools(server: McpServer) {
- src/core/services/index.ts:6-7 (helper)Re-export of transactions service functions including getTransactionReceipt in services index.export * from './transactions.js'; export * from './contracts.js';