arbtrace_callMany
Batch trace multiple calls on Arbitrum nodes using the trace API. Streamlines analysis by resolving chain names and handling block-specific queries efficiently.
Instructions
Trace multiple calls in batch for efficiency (requires trace API)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| blockNumOrHash | No | Block number or hash (defaults to 'latest') | |
| calls | Yes | Array of call objects to trace | |
| 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) |
Implementation Reference
- src/index.ts:485-502 (handler)MCP server handler for the 'arbtrace_callMany' tool. Resolves the RPC URL (from args or chain name), instantiates NitroNodeClient, calls its traceCallMany method, and returns the result as text content.case "arbtrace_callMany": { const rpcUrl = await this.resolveRpcUrl( (args.rpcUrl as string) || (args.chainName as string) ); const nodeClient = new NitroNodeClient(rpcUrl); const result = await nodeClient.traceCallMany( args.calls as any[], args.blockNumOrHash as string ); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- src/index.ts:1206-1234 (schema)Input schema definition for the arbtrace_callMany tool, defining parameters like rpcUrl, chainName, calls (required), and blockNumOrHash.name: "arbtrace_callMany", description: "Trace multiple calls in batch for efficiency (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", }, calls: { type: "array", description: "Array of call objects to trace", items: { type: "object" }, }, blockNumOrHash: { type: "string", description: "Block number or hash (defaults to 'latest')", }, }, required: ["calls"], }, },
- Helper method in NitroNodeClient that makes the actual RPC call to 'arbtrace_callMany' on the Arbitrum Nitro node, handling errors and returning TraceResult.async traceCallMany( calls: any[], blockNumOrHash?: string ): Promise<TraceResult> { try { const traces = await this.makeRpcCall("arbtrace_callMany", [ calls, blockNumOrHash || "latest", ]); return { traces }; } catch (error) { return { traces: null, error: `Trace callMany not supported on this RPC endpoint: ${ (error as Error).message }`, }; } }