Skip to main content
Glama
dewanshparashar

Arbitrum MCP Server

is_contract

Determine if an Arbitrum address represents a smart contract by checking its code storage. This tool helps verify contract existence for interactions and security assessments on Arbitrum networks.

Instructions

Check if an address is a contract

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rpcUrlNoThe RPC URL of the chain (optional if default is set)
addressYesAddress to check

Implementation Reference

  • Handler for the 'is_contract' MCP tool. Resolves RPC URL, creates EthereumAccountClient instance, calls isContract(address), and returns whether the address is a contract.
    case "is_contract": {
      const rpcUrl = await this.resolveRpcUrl(
        (args.rpcUrl as string) || (args.chainName as string)
      );
      const ethereumAccountClient = new EthereumAccountClient(rpcUrl);
      const isContract = await ethereumAccountClient.isContract(
        args.address as string
      );
      return {
        content: [
          {
            type: "text",
            text: `Is contract: ${isContract}`,
          },
        ],
      };
    }
  • Input schema definition for the 'is_contract' tool, specifying parameters rpcUrl (optional) and address (required). Part of the tools list returned by list tools request.
      name: "is_contract",
      description: "Check if an address is a contract",
      inputSchema: {
        type: "object" as const,
        properties: {
          rpcUrl: {
            type: "string",
            description:
              "The RPC URL of the chain (optional if default is set)",
          },
          address: {
            type: "string",
            description: "Address to check",
          },
        },
        required: ["address"],
      },
    },
  • src/index.ts:1020-1037 (registration)
    Tool registration in the getAvailableTools() method, which defines the 'is_contract' tool name, description, and schema for the MCP list tools endpoint.
      name: "is_contract",
      description: "Check if an address is a contract",
      inputSchema: {
        type: "object" as const,
        properties: {
          rpcUrl: {
            type: "string",
            description:
              "The RPC URL of the chain (optional if default is set)",
          },
          address: {
            type: "string",
            description: "Address to check",
          },
        },
        required: ["address"],
      },
    },
  • Core helper function in EthereumAccountClient that implements the contract check logic by fetching bytecode via getCode and checking if it's non-empty ('0x'). Called by the tool handler.
    async isContract(address: string): Promise<boolean> {
      const code = await this.getCode(address);
      return code !== '0x';
    }
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 action ('Check') but doesn't describe what 'contract' means in this context, potential errors (e.g., invalid addresses), rate limits, or response format. This is inadequate for a tool with network dependencies.

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

Conciseness5/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 function without unnecessary words. It's front-loaded and wastes no space, making it easy to parse quickly.

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?

For a tool that interacts with a blockchain (implied by RPC and address parameters), the description is incomplete. It lacks output details (no schema provided), doesn't explain what constitutes a 'contract' versus other address types, and omits error handling or network behavior, leaving gaps for the agent.

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%, so the schema fully documents both parameters. The description doesn't add any semantic context beyond implying the 'address' parameter is the target, which is already clear from the schema. This meets the baseline for high schema coverage.

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 tool's purpose with a specific verb ('Check') and resource ('if an address is a contract'), making it immediately understandable. However, it doesn't differentiate from sibling tools like 'get_balance' or 'get_transaction', which also operate on addresses but serve different purposes.

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 provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing an RPC URL), exclusions, or related tools for checking address properties, leaving the agent to infer usage from context alone.

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