Skip to main content
Glama

evm_get_token_balance

Retrieve ERC20 token balances for any wallet on supported EVM chains, returning raw and human-readable amounts with automatic decimal handling.

Instructions

Get ERC20 token balance for any wallet address on any supported EVM chain.

Returns the token balance in both raw units and human-readable format accounting for token decimals. Works with any ERC20-compliant token contract across all 7 supported EVM chains.

CRITICAL RULES:

  • Token address MUST be a valid ERC20 contract (has decimals(), balanceOf())

  • Returns 0 balance for addresses that never held the token (not an error)

  • Decimals are fetched automatically from token contract (typically 6 or 18)

  • Balance units depend on token decimals (USDC=6, most tokens=18)

  • Does NOT work with native tokens (use evm_get_balance for ETH/POL/etc)

PARAMETERS:

  • chain: EVM chain where token is deployed (required)

    • Token contracts are chain-specific

    • Same token may have different addresses per chain

    • Example: USDC on Polygon vs USDC on Ethereum

  • tokenAddress: ERC20 token contract address (required)

    • Format: 0x followed by 40 hex characters

    • Must be deployed contract with ERC20 interface

    • Examples: USDC, USDT, DAI, WETH, custom tokens

  • walletAddress: Address to check balance for (required)

    • Any valid Ethereum address

    • Can be EOA (user wallet) or contract address

    • Format: 0x followed by 40 hex characters

EXAMPLES: ✅ Check USDC balance on Polygon: {chain: "polygon", tokenAddress: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", walletAddress: "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"}

✅ Check custom token on BSC: {chain: "bsc", tokenAddress: "0x...", walletAddress: "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"}

✅ Check WETH balance on Arbitrum: {chain: "arbitrum", tokenAddress: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1", walletAddress: "0x..."}

❌ Invalid - trying to check native ETH (use evm_get_balance): {chain: "ethereum", tokenAddress: "0x0000000000000000000000000000000000000000", walletAddress: "0x..."}

❌ Invalid - wrong chain (token not deployed there): {chain: "avalanche", tokenAddress: "0x2791Bca...POLYGON_USDC", walletAddress: "0x..."}

SUPPORTED EVM CHAINS (7 networks): • ethereum (Sepolia) - EIP-1559 enabled, ~12s blocks, moderate gas costs • polygon (Amoy) - Low fees, fast finality (~2s), layer 2 • avalanche (Fuji C-Chain) - Sub-second finality, dynamic fees • bsc (BNB Testnet) - 3s blocks, low gas costs, Binance ecosystem • arbitrum (Sepolia) - Optimistic rollup, low fees, Ethereum security • base (Sepolia) - Coinbase layer 2, EIP-1559, low fees • worldchain (World Sepolia) - World Network testnet, EIP-1559

CRITICAL GAS CONSIDERATIONS:

  • Ethereum: High gas costs, use gas oracle for timing

  • Polygon/BSC: Very low gas, safe for frequent transactions

  • Arbitrum/Base: L2 optimizations, ~10-50x cheaper than Ethereum

  • Avalanche: Dynamic fees, can spike during congestion

  • Always check gas price before executing transactions

TESTNET TOKENS: All chains use testnet tokens with NO REAL VALUE. Faucets available for all supported networks.

OUTPUT STRUCTURE: • success: Boolean indicating query success • chain: Chain queried • tokenAddress: Token contract address • walletAddress: Wallet checked • balance: Object with raw (string) and formatted (string) values • decimals: Number of decimals the token uses • executionTime: Time taken in milliseconds

COMMON MISTAKES:

  • Using native token address (use evm_get_balance for ETH/POL/AVAX)

  • Using token address from wrong chain (USDC Polygon ≠ USDC Ethereum)

  • Not accounting for decimals when interpreting raw balance

  • Expecting USD value (this returns token units, not dollar value)

  • Forgetting tokens are chain-specific (must deploy/bridge to each chain)

USE CASES:

  • Check token holdings before initiating transfers

  • Verify token receipt after purchase or swap

  • Monitor token balances across multiple chains

  • Validate sufficient token balance for DeFi operations

  • Build portfolio tracking dashboards

TOKEN DECIMALS REFERENCE:

  • Most tokens: 18 decimals (same as ETH)

  • Stablecoins (USDC, USDT): 6 decimals

  • Bitcoin-pegged (WBTC): 8 decimals

  • Custom tokens: varies (fetched automatically)

Running on Linux.

LINUX-SPECIFIC NOTES:

  • Package manager: apt (Ubuntu/Debian), yum (RHEL/CentOS), or pacman (Arch)

  • Python 3 is typically 'python3' command

  • GNU tools are standard

  • Use 'xdg-open' command to open files/applications

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "chain": "<chain>",
      "tokenAddress": "<tokenAddress>",
      "walletAddress": "<walletAddress>"
    },
    "name": "evm_get_token_balance"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainYesEVM chain to query
tokenAddressYesERC20 token contract address (0x...)
walletAddressYesWallet address to check balance for (0x...)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses that a zero balance is returned rather than an error, that decimals are auto-fetched from the contract, and it enumerates the output fields. Gaps remain around performance/rate limits and whether the call requires any auth, and the gas-cost commentary is irrelevant to a read-only balance query.

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

Conciseness2/5

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

The core contract is front-loaded, but the bulk is padding: gas considerations for a read-only call, per-chain block times, testnet faucet notes, and the Linux shell notes are all irrelevant. The same guidance could be delivered in a quarter of the length.

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

Completeness5/5

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

No output schema exists, yet the OUTPUT STRUCTURE section documents every returned field including the raw/formatted balance object, decimals, and executionTime. Combined with examples and pitfalls, nothing needed to invoke and interpret the tool is missing.

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

Parameters5/5

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

Schema coverage is already 100%, but the description adds real meaning beyond it: chain-specificity of token contracts, the 0x+40-hex address format, EOA-vs-contract acceptance, and worked examples per chain. This is more than the schema provides.

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

Purpose5/5

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

Opening sentence states a specific verb (Get) and resource (ERC20 token balance) with scope (any wallet, any supported EVM chain). It explicitly distinguishes itself from evm_get_balance for native tokens, so an agent can route without opening the schema.

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

Usage Guidelines5/5

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

The CRITICAL RULES and COMMON MISTAKES sections name the alternative tool for native tokens (evm_get_balance) and the exact wrong-input conditions (zero address, cross-chain token address mismatch). The USE CASES section adds concrete trigger scenarios such as verifying receipt after a swap.

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

Deploy Server

Other Tools