arbtrace_filter
Filter transaction traces on Arbitrum networks using specific criteria to analyze blockchain activity and debug smart contracts.
Instructions
Filter traces based on specified criteria (requires trace API)
Input 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 | |
| filter | Yes | Filter criteria for traces |
Implementation Reference
- src/index.ts:597-611 (handler)MCP server tool handler for 'arbtrace_filter': resolves RPC URL using chain name or direct URL, creates NitroNodeClient instance, invokes traceFilter method with provided filter, and returns the result as formatted JSON text content.
case "arbtrace_filter": { const rpcUrl = await this.resolveRpcUrl( (args.rpcUrl as string) || (args.chainName as string) ); const nodeClient = new NitroNodeClient(rpcUrl); const result = await nodeClient.traceFilter(args.filter); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; } - src/index.ts:1378-1401 (registration)Tool registration in MCP server's getAvailableTools() method, including name, description, and inputSchema defining parameters: rpcUrl (optional), chainName (optional), filter (required object).
name: "arbtrace_filter", description: "Filter traces based on specified criteria (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", }, filter: { type: "object", description: "Filter criteria for traces", }, }, required: ["filter"], }, }, - NitroNodeClient helper method traceFilter that performs the actual RPC call to 'arbtrace_filter' with the filter parameter, handles errors, and returns TraceResult.
async traceFilter(filter: any): Promise<TraceResult> { try { const traces = await this.makeRpcCall("arbtrace_filter", [filter]); return { traces }; } catch (error) { return { traces: null, error: `Trace filter not supported on this RPC endpoint: ${ (error as Error).message }`, }; } }