arbtrace_block
Retrieve detailed transaction trace data for any Arbitrum block to analyze execution paths, debug smart contracts, and monitor network activity.
Instructions
Get trace information for all transactions in a block (requires trace API)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rpcUrl | No | The RPC URL of the Arbitrum node (optional if default is set) | |
| chainName | No | Chain name (e.g., 'Xai', 'Arbitrum One') - will auto-resolve to RPC URL | |
| blockNumOrHash | Yes | Block number or hash to trace |
Implementation Reference
- src/index.ts:579-595 (handler)MCP tool handler for 'arbtrace_block': resolves RPC URL using chain name or provided URL, creates NitroNodeClient instance, calls traceBlock method, and returns JSON-formatted result.case "arbtrace_block": { const rpcUrl = await this.resolveRpcUrl( (args.rpcUrl as string) || (args.chainName as string) ); const nodeClient = new NitroNodeClient(rpcUrl); const result = await nodeClient.traceBlock( args.blockNumOrHash as string ); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:1352-1376 (schema)Input schema definition for the 'arbtrace_block' tool, specifying parameters like rpcUrl, chainName (optional), and required blockNumOrHash, along with description.{ name: "arbtrace_block", description: "Get trace information for all transactions in a block (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", }, blockNumOrHash: { type: "string", description: "Block number or hash to trace", }, }, required: ["blockNumOrHash"], }, },
- src/index.ts:93-102 (registration)Registration of ListToolsRequestSchema handler that returns the list of available tools, including 'arbtrace_block' via getAvailableTools().this.server.setRequestHandler(ListToolsRequestSchema, async () => { try { console.error("Handling list tools request"); return { tools: this.getAvailableTools(), }; } catch (error) { console.error("Error in list tools handler:", error); throw error; }
- Helper method traceBlock in NitroNodeClient that performs the actual RPC call to 'arbtrace_block' with blockNumOrHash parameter, handles errors gracefully.async traceBlock(blockNumOrHash: string): Promise<TraceResult> { try { const traces = await this.makeRpcCall("arbtrace_block", [blockNumOrHash]); return { traces }; } catch (error) { return { traces: null, error: `Trace block not supported on this RPC endpoint: ${ (error as Error).message }`, }; } }