Skip to main content
Glama
dewanshparashar

Arbitrum MCP Server

get_balance_ether

Check ETH balance for any Ethereum address on Arbitrum networks using this tool. Query wallet holdings to monitor funds across Arbitrum chains.

Instructions

Get balance of an address in ETH

Input Schema

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

Implementation Reference

  • MCP tool handler for 'get_balance_ether': resolves RPC URL, instantiates EthereumAccountClient, calls getBalanceInEther on the provided address, formats response as text content.
    case "get_balance_ether": { const rpcUrl = await this.resolveRpcUrl( (args.rpcUrl as string) || (args.chainName as string) ); const ethereumAccountClient = new EthereumAccountClient(rpcUrl); const balanceEth = await ethereumAccountClient.getBalanceInEther( args.address as string ); return { content: [ { type: "text", text: `Balance: ${balanceEth} ETH`, }, ], }; }
  • src/index.ts:962-980 (registration)
    Tool registration definition in getAvailableTools(): specifies name 'get_balance_ether', description, and input schema requiring 'address' (rpcUrl and chainName optional). Used for list tools response.
    { name: "get_balance_ether", description: "Get balance of an address in ETH", 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"], }, },
  • Input schema definition for 'get_balance_ether' tool: object with optional rpcUrl/chainName and required address string.
    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"], },
  • Primary helper implementation: getBalanceInEther(address) converts wei balance to human-readable ETH string, handling integer and decimal cases precisely.
    async getBalanceInEther(address: string): Promise<string> { const weiBalance = await this.getBalance(address); const wei = BigInt(weiBalance); const ether = wei / BigInt('1000000000000000000'); const remainder = wei % BigInt('1000000000000000000'); if (remainder === BigInt(0)) { return ether.toString(); } else { const etherDecimal = Number(wei) / 1e18; return etherDecimal.toFixed(6).replace(/\.?0+$/, ''); } }
  • Supporting helper: getBalance(address) performs raw 'eth_getBalance' RPC call at latest block, returns wei 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