arbtrace_replayTransaction
Replay and trace a transaction on Arbitrum chains using a transaction hash. Supports multiple trace types to analyze transaction details and state changes.
Instructions
Replay and trace a specific transaction (requires trace API)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chainName | No | Chain name (e.g., 'Xai', 'Arbitrum One') - will auto-resolve to RPC URL | |
| rpcUrl | No | The RPC URL of the Arbitrum node (optional if default is set) | |
| traceTypes | No | Array of trace types (e.g., ['trace', 'stateDiff']) | |
| txHash | Yes | Transaction hash to replay |
Implementation Reference
- src/clients/nitro-node-client.ts:277-295 (handler)Core handler function in NitroNodeClient that executes the RPC call to 'arbtrace_replayTransaction' on the Arbitrum Nitro node.async replayTransaction( txHash: string, traceTypes: string[] ): Promise<TraceResult> { try { const traces = await this.makeRpcCall("arbtrace_replayTransaction", [ txHash, traceTypes, ]); return { traces }; } catch (error) { return { traces: null, error: `Trace replayTransaction not supported on this RPC endpoint: ${ (error as Error).message }`, }; } }
- src/index.ts:523-540 (handler)MCP server tool handler that resolves RPC URL, creates NitroNodeClient, calls replayTransaction, and formats response.case "arbtrace_replayTransaction": { const rpcUrl = await this.resolveRpcUrl( (args.rpcUrl as string) || (args.chainName as string) ); const nodeClient = new NitroNodeClient(rpcUrl); const result = await nodeClient.replayTransaction( args.txHash as string, (args.traceTypes as string[]) || ["trace"] ); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:1267-1295 (schema)Tool schema definition including name, description, and input schema for validation in MCP listTools response.name: "arbtrace_replayTransaction", description: "Replay and trace a specific transaction (requires trace API)", inputSchema: { type: "object" as const, properties: { rpcUrl: { type: "string", description: "The RPC URL of the Arbitrum node (optional if default is set)", }, chainName: { type: "string", description: "Chain name (e.g., 'Xai', 'Arbitrum One') - will auto-resolve to RPC URL", }, txHash: { type: "string", description: "Transaction hash to replay", }, traceTypes: { type: "array", description: "Array of trace types (e.g., ['trace', 'stateDiff'])", items: { type: "string" }, }, }, required: ["txHash"], },