get_transaction_receipt
Retrieve transaction receipts on Arbitrum networks using transaction hashes to verify execution status and details.
Instructions
Get transaction receipt by hash
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rpcUrl | No | The RPC URL of the chain (optional if default is set) | |
| txHash | Yes | Transaction hash |
Implementation Reference
- src/index.ts:288-304 (handler)Handler logic for the get_transaction_receipt MCP tool. Resolves RPC URL from args or chainName, creates EthereumAccountClient instance, fetches transaction receipt using the client's method, and returns JSON stringified response.case "get_transaction_receipt": { const rpcUrl = await this.resolveRpcUrl( (args.rpcUrl as string) || (args.chainName as string) ); const ethereumAccountClient = new EthereumAccountClient(rpcUrl); const receipt = await ethereumAccountClient.getTransactionReceipt( args.txHash as string ); return { content: [ { type: "text", text: JSON.stringify(receipt, null, 2), }, ], }; }
- src/index.ts:1001-1018 (schema)Input schema definition for the get_transaction_receipt tool returned by list tools handler. Defines required txHash and optional rpcUrl parameters.name: "get_transaction_receipt", description: "Get transaction receipt by hash", inputSchema: { type: "object" as const, properties: { rpcUrl: { type: "string", description: "The RPC URL of the chain (optional if default is set)", }, txHash: { type: "string", description: "Transaction hash", }, }, required: ["txHash"], }, },
- Core implementation of transaction receipt fetching via eth_getTransactionReceipt RPC call, with response parsing to Receipt type. Called by the MCP tool handler.async getTransactionReceipt(txHash: string): Promise<Receipt> { const receipt = await this.makeRpcCall('eth_getTransactionReceipt', [txHash]); if (!receipt) { throw new Error(`Transaction receipt for ${txHash} not found`); } return { transactionHash: receipt.transactionHash, transactionIndex: parseInt(receipt.transactionIndex, 16), blockHash: receipt.blockHash, blockNumber: parseInt(receipt.blockNumber, 16), from: receipt.from, to: receipt.to, cumulativeGasUsed: parseInt(receipt.cumulativeGasUsed, 16), gasUsed: parseInt(receipt.gasUsed, 16), contractAddress: receipt.contractAddress, logs: receipt.logs, status: receipt.status }; }
- TypeScript interface defining the structure of the transaction receipt object returned by the helper method.export interface Receipt { transactionHash: string; transactionIndex: number; blockHash: string; blockNumber: number; from: string; to: string | null; cumulativeGasUsed: number; gasUsed: number; contractAddress: string | null; logs: any[]; status: string; }