Skip to main content
Glama
dewanshparashar

Arbitrum MCP Server

get_balance

Query the balance of an Ethereum address in wei using the Arbitrum MCP Server. Input the address and optional RPC URL to retrieve account balance details.

Instructions

Get balance of an address in wei

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesEthereum address to check balance for
rpcUrlNoThe RPC URL of the chain (optional if default is set)

Implementation Reference

  • The core handler logic for the 'get_balance' MCP tool. Resolves the RPC endpoint using provided rpcUrl or chainName via ChainLookupService, instantiates EthereumAccountClient, calls getBalance(address) to fetch wei balance via eth_getBalance RPC, and formats response as text content.
    case "get_balance": { const rpcUrl = await this.resolveRpcUrl( (args.rpcUrl as string) || (args.chainName as string) ); const ethereumAccountClient = new EthereumAccountClient(rpcUrl); const balance = await ethereumAccountClient.getBalance( args.address as string ); return { content: [ { type: "text", text: `Balance: ${balance} wei`, }, ], }; }
  • src/index.ts:943-961 (registration)
    Tool registration in getAvailableTools() method returned by ListToolsRequestSchema handler. Defines name, description, and inputSchema for 'get_balance'.
    { name: "get_balance", description: "Get balance of an address in wei", 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: "Ethereum address to check balance for", }, }, required: ["address"], }, },
  • JSON schema defining input parameters: 'address' (required, string), 'rpcUrl' (optional, string). Note: handler also accepts 'chainName' via args though not in schema.
    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: "Ethereum address to check balance for", }, }, required: ["address"],
  • Supporting utility method in EthereumAccountClient that executes the 'eth_getBalance' RPC call at 'latest' block, returning raw wei balance as hex string.
    async getBalance(address: string): Promise<string> { const balance = await this.makeRpcCall('eth_getBalance', [address, 'latest']); return balance; }

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