Skip to main content
Glama
dewanshparashar

Arbitrum MCP Server

arbtrace_replayTransaction

Replay and trace Arbitrum transactions to analyze execution details and state changes using trace API capabilities.

Instructions

Replay and trace a specific transaction (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
txHashYesTransaction hash to replay
traceTypesNoArray of trace types (e.g., ['trace', 'stateDiff'])

Implementation Reference

  • MCP tool handler for 'arbtrace_replayTransaction': resolves RPC URL or chain name to RPC, creates NitroNodeClient instance, calls its replayTransaction method with txHash and traceTypes (defaulting to ['trace']), and returns the result as JSON-formatted text content.
    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),
          },
        ],
      };
    }
  • Input schema definition for the arbtrace_replayTransaction MCP tool, specifying properties for rpcUrl (optional), chainName (optional), txHash (required), and traceTypes (optional array).
      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"],
      },
    },
  • NitroNodeClient.replayTransaction method: core implementation that performs the actual RPC call to the Nitro node's 'arbtrace_replayTransaction' method with txHash and traceTypes parameters, returning traces or error.
    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
          }`,
        };
      }
    }
  • Utility method makeRpcCall used by all client methods to perform HTTP POST RPC requests to the Nitro node RPC endpoint.
      private async makeRpcCall(method: string, params: any[]): Promise<any> {
        try {
          const requestBody = {
            jsonrpc: "2.0",
            id: Date.now(),
            method,
            params,
          };
    
          console.error(`Making RPC call to ${this.rpcUrl}: ${method}`);
          
          const response = await fetch(this.rpcUrl, {
            method: "POST",
            headers: {
              "Content-Type": "application/json",
            },
            body: JSON.stringify(requestBody),
          });
    
          if (!response.ok) {
            throw new Error(`HTTP ${response.status}: ${response.statusText}`);
          }
    
          const data = await response.json();
    
          if (data.error) {
            throw new Error(`RPC Error: ${data.error.message}`);
          }
    
          return data.result;
        } catch (error) {
          console.error(`RPC call failed for ${method} on ${this.rpcUrl}:`, error);
          if (error instanceof Error) {
            throw error;
          } else {
            throw new Error(`Unknown error during RPC call: ${String(error)}`);
          }
        }
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool replays and traces transactions and mentions a prerequisite ('requires trace API'), but doesn't describe what 'replay' entails, what the output looks like, whether it's read-only or destructive, or any rate limits or authentication needs. This leaves significant behavioral gaps for a tool with 4 parameters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose and prerequisite. It's appropriately sized and front-loaded with the core functionality, though it could be slightly more structured by separating the prerequisite into a second sentence for clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (4 parameters, no annotations, no output schema), the description is incomplete. It lacks details on behavioral traits, output format, and usage context relative to siblings. For a transaction replay tool with multiple parameters and no structured output documentation, the description should provide more comprehensive guidance to be complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, meaning all parameters are documented in the input schema. The description doesn't add any parameter-specific information beyond what's in the schema (e.g., it doesn't explain 'traceTypes' options or 'chainName' mappings). According to the rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Replay and trace') and the target resource ('a specific transaction'), which provides a specific verb+resource combination. However, it doesn't distinguish this tool from sibling tools like 'arbtrace_transaction' or 'arbtrace_replayBlockTransactions', missing explicit differentiation that would warrant a score of 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description mentions a prerequisite ('requires trace API') but provides no guidance on when to use this tool versus alternatives like 'arbtrace_transaction' or 'arbtrace_replayBlockTransactions'. There's no explicit when/when-not instructions or named alternatives, resulting in minimal usage guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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