Skip to main content
Glama

ERC-20 Balance (Multicall)

erc20_balance
Read-only

Balances of up to 20 arbitrary ERC-20 tokens for one wallet in a single Multicall3 round-trip: raw and decimal-formatted balance, decimals and symbol per token, on Base, Ethereum, BSC, Polygon, Arbitrum or Optimism. Pay per call with USDC or USDT on Base via x402. 3 free calls per wallet.

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": {
      "wallet_address": "<wallet_address>",
      "contract_addresses": "<contract_addresses>"
    },
    "name": "erc20_balance"
  }
}

Input Schema

NameRequiredDescriptionDefault
chainNobase (default), ethereum, bsc, polygon, arbitrum, optimism.
walletNoYour EVM wallet address (0x...). Unlocks the free tier (3 free calls per wallet).
api_keyNoOptional AMR enterprise API key.
x_paymentNoOptional signed x402 payment payload (base64 JSON) for USDC/USDT on Base.
wallet_addressYesEVM wallet address.
contract_addressesYes1-20 ERC-20 contract addresses.

Output Schema

NameRequiredDescriptionDefault
chainYes
tokenNoToken actually used for payment (USDC, USDT or FREE).USDC
sourceYes
tokensYes
routingYesHow the request was routed (provider, fallback, cache, latency).
chain_idYes
cost_usdcYesPrice charged in stablecoin units (USDC/USDT 1:1); 0 on the free tier.
fetched_atNoUTC timestamp when the data was fetched.
token_countYes
block_numberYes
wallet_addressYes
freshness_secondsYesAge of the underlying data in seconds (0 = fetched live).
x_payment_responseNoBase64-encoded x402 settlement receipt (mirrors the X-PAYMENT-RESPONSE header). Only present when the call was paid with `x_payment`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "description": "Response for ``POST /erc20-balance``.",
      +  "properties": {
      +    "block_number": {
      +      "title": "Block Number",
      +      "type": "integer"
      +    },
      +    "chain": {
      +      "title": "Chain",
      +      "type": "string"
      +    },
      +    "chain_id": {
      +      "title": "Chain Id",
      +      "type": "integer"
      +    },
      +    "cost_usdc": {
      +      "description": "Price charged in stablecoin units (USDC/USDT 1:1); 0 on the free tier.",
      +      "title": "Cost Usdc",
      +      "type": "number"
      +    },
      +    "fetched_at": {
      +      "description": "UTC timestamp when the data was fetched.",
      +      "format": "date-time",
      +      "title": "Fetched At",
      +      "type": "string"
      +    },
      +    "freshness_seconds": {
      +      "description": "Age of the underlying data in seconds (0 = fetched live).",
      +      "title": "Freshness Seconds",
      +      "type": "integer"
      +    },
      +    "routing": {
      +      "description": "How the request was routed (provider, fallback, cache, latency).",
      +      "properties": {
      +        "cache_hit": {
      +          "default": false,
      +          "description": "True if the result was served from cache.",
      +          "title": "Cache Hit",
      +          "type": "boolean"
      +        },
      +        "fallback_used": {
      +          "default": false,
      +          "description": "True if the primary provider failed and a fallback served the result.",
      +          "title": "Fallback Used",
      +          "type": "boolean"
      +        },
      +        "latency_ms": {
      +          "default": 0,
      +          "description": "End-to-end routing latency in milliseconds.",
      +          "title": "Latency Ms",
      +          "type": "integer"
      +        },
      +        "provider": {
      +          "description": "Name of the upstream provider that served the result.",
      +          "title": "Provider",
      +          "type": "string"
      +        },
      +        "providers_tried": {
      +          "description": "Providers attempted, in order.",
      +          "items": {
      +            "type": "string"
      +          },
      +          "title": "Providers Tried",
      +          "type": "array"
      +        }
      +      },
      +      "required": [
      +        "provider"
      +      ],
      +      "title": "RoutingMeta",
      +      "type": "object"
      +    },
      +    "source": {
      +      "title": "Source",
      +      "type": "string"
      +    },
      +    "token": {
      +      "default": "USDC",
      +      "description": "Token actually used for payment (USDC, USDT or FREE).",
      +      "title": "Token",
      +      "type": "string"
      +    },
      +    "token_count": {
      +      "title": "Token Count",
      +      "type": "integer"
      +    },
      +    "tokens": {
      +      "items": {
      +        "properties": {
      +          "balance": {
      +            "anyOf": [
      +              {
      +                "type": "number"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ],
      +            "default": null,
      +            "title": "Balance"
      +          },
      +          "contract": {
      +            "title": "Contract",
      +            "type": "string"
      +          },
      +          "decimals": {
      +            "anyOf": [
      +              {
      +                "type": "integer"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ],
      +            "default": null,
      +            "title": "Decimals"
      +          },
      +          "error": {
      +            "anyOf": [
      +              {
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ],
      +            "default": null,
      +            "title": "Error"
      +          },
      +          "raw": {
      +            "anyOf": [
      +              {
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ],
      +            "default": null,
      +            "title": "Raw"
      +          },
      +          "symbol": {
      +            "anyOf": [
      +              {
      +                "type": "string"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ],
      +            "default": null,
      +            "title": "Symbol"
      +          }
      +        },
      +        "required": [
      +          "contract"
      +        ],
      +        "title": "Erc20TokenBalance",
      +        "type": "object"
      +      },
      +      "title": "Tokens",
      +      "type": "array"
      +    },
      +    "wallet_address": {
      +      "title": "Wallet Address",
      +      "type": "string"
      +    },
      +    "x_payment_response": {
      +      "description": "Base64-encoded x402 settlement receipt (mirrors the X-PAYMENT-RESPONSE header). Only present when the call was paid with `x_payment`.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "freshness_seconds",
      +    "cost_usdc",
      +    "routing",
      +    "wallet_address",
      +    "chain",
      +    "chain_id",
      +    "block_number",
      +    "tokens",
      +    "token_count",
      +    "source"
      +  ],
      +  "type": "object"
      +}
  2. Changed1 schema field changed
    • changedInput schema / properties / wallet / description
      Previous value: -"Your EVM wallet address (0x...). Unlocks the free tier (3 calls per wallet)."New value: +"Your EVM wallet address (0x...). Unlocks the free tier (3 free calls per wallet)."
  3. Added

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, and the description adds meaningful context: Multicall3 batching, supported chains, the x402 payment mechanism, and the 3-free-calls-per-wallet limit. There is no contradiction between the description and the annotations.

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?

Two sentences are packed with high-signal information: return contents, token scope, multicall batching, supported chains, payment options, and free tier. The core purpose is front-loaded and no filler is present.

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

Completeness4/5

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

The description covers the essential calling context: what is returned, how many tokens, which chains, and how to pay. Since an output schema exists, return-value details are handled structurally; the only slight gap is explicit when-to-use/alternative routing among the many balance- and price-related siblings.

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?

The input schema already documents all six parameters with 100% coverage, so the description does not need to compensate. It reinforces useful constraints like 1-20 contract addresses and one-wallet scope, but it does not clarify the distinction between 'wallet' and 'wallet_address' beyond what the schema already says.

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?

The description opens with a specific verb ('Balances') and names the exact resource: up to 20 arbitrary ERC-20 tokens for one wallet, including raw and decimal-formatted balances, decimals, and symbols. Saying 'arbitrary ERC-20 tokens' and 'one wallet' clearly distinguishes it from sibling tools like wallet_balance or token_price.

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

Usage Guidelines4/5

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

The description clearly implies use for batched ERC-20 balance checks for a single wallet in one multicall round-trip, and it adds payment/free-tier context. It does not explicitly say when not to use it or name alternatives such as wallet_balance or token_price, so it stops just short of full routing guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.