Skip to main content
Glama
dewanshparashar

Arbitrum MCP Server

is_contract

Verify if a given address is a smart contract on Arbitrum chains. Input the address and optional RPC URL to determine its contract status efficiently.

Instructions

Check if an address is a contract

Input Schema

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

Implementation Reference

  • MCP tool handler for 'is_contract': resolves RPC URL, creates EthereumAccountClient instance, calls isContract(address), and returns result as text content.
    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}`, }, ], }; }
  • Tool schema definition for 'is_contract' including input schema with rpcUrl (optional) and address (required). Registered in getAvailableTools().
    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 method isContract(address) that fetches bytecode via getCode and checks if non-empty (not '0x'). Called by the main handler.
    async isContract(address: string): Promise<boolean> { const code = await this.getCode(address); return code !== '0x'; }
  • Supporting getCode(address) method that makes eth_getCode RPC call, used by isContract.
    async getCode(address: string): Promise<string> { return await this.makeRpcCall('eth_getCode', [address, 'latest']); }

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