Skip to main content
Glama

get_token_balance

Retrieve the ERC-20 or SPL token balance for a wallet on a specified chain, returning both raw and human-readable amounts for on-chain verification.

Instructions

Get the ERC-20 or SPL token balance for a wallet on a specific chain. Returns the raw balance and human-readable balance. Use get_chains to find stablecoin addresses for each chain.

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_id": "<wallet_id>",
      "token": "<token>",
      "chain_id": "<chain_id>"
    },
    "name": "get_token_balance"
  }
}

Input Schema

NameRequiredDescriptionDefault
tokenYesToken address (0x-prefixed ERC-20 contract for EVM, Base58 mint for Solana)
chain_idYesChain ID to check on
decimalsNoToken decimals. Taken from the response or the token contract when omitted
wallet_idYesWallet ID to check

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.14.8
    • addedInput schema / properties / chain_id / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / chain_id / minimum
      Added value: +-9007199254740991
    • addedInput schema / properties / wallet_id / maximum
      Added value: +9007199254740991
    • addedInput schema / properties / wallet_id / minimum
      Added value: +-9007199254740991
  2. Changed4 schema fields changedv1.14.2
    • removedInput schema / properties / decimals / default
      Removed value: -18
    • changedInput schema / properties / decimals / description
      Previous value: -"Token decimals (6 for USDC, 18 for most tokens)"New value: +"Token decimals. Taken from the response or the token contract when omitted"
    • addedInput schema / properties / decimals / maximum
      Added value: +36
    • addedInput schema / properties / decimals / minimum
      Added value: +0
  3. First observedv1.7.3

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It does disclose the return shape ('raw balance and human-readable balance'), implying decimals normalization, and 'Get' signals a read-only operation. It says nothing about failure modes (invalid token address, unmocked chain, unknown wallet_id) or whether results are live on-chain reads or cached.

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

Conciseness4/5

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

Three short sentences: purpose first, output shape second, prerequisite pointer last. Nothing is redundant, though the get_chains sentence is a workflow aside that slightly dilutes the front-loaded structure.

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?

For a no-annotation, no-output-schema, 4-parameter read tool, the definition covers purpose, return values, and how to source the token address. The remaining gaps — error behavior and the get_balance alternative — are real but modest for a simple balance lookup.

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?

Schema description coverage is 100%, so all four parameters are already documented, which sets the baseline at 3. The description adds only indirect meaning — 'on a specific chain' for chain_id and the pointer to get_chains for the token address — and never mentions the optional decimals parameter or when to supply it over the contract-derived default.

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

Purpose4/5

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

States a specific verb and resource: fetching an ERC-20 or SPL token balance for a wallet on a given chain. The token-standard framing implicitly separates it from the sibling get_balance (native balance), but it never names that sibling explicitly, so the agent must infer the distinction.

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

Usage Guidelines3/5

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

The closing sentence gives a concrete prerequisite workflow — use get_chains to obtain stablecoin/token addresses per chain — which is genuinely useful routing guidance. However, there is no statement of when to prefer get_balance over this tool, no when-not guidance, and no mention of unsupported chains or missing wallets.

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