Skip to main content
Glama
dewanshparashar

Arbitrum MCP Server

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
NameRequiredDescriptionDefault
rpcUrlNoThe RPC URL of the Arbitrum node (optional if default is set)
chainNameNoChain name (e.g., 'Xai', 'Arbitrum One') - will auto-resolve to RPC URL
blockNumOrHashYesBlock number or hash to trace

Implementation Reference

  • 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),
          },
        ],
      };
    }
  • 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
          }`,
        };
      }
    }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dewanshparashar/arbitrum-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server