Skip to main content
Glama

check_balance

View USDC balance and wallet address for configured accounts to monitor cryptocurrency holdings and verify payment readiness.

Instructions

Check the USDC balance and address for the configured wallet.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The check_balance tool is registered and implemented within registerWalletTools in src/tools/wallet.ts. It uses the clientCache to fetch the wallet balance and address and returns it as a formatted JSON string.
    server.tool(
      'check_balance',
      'Check the USDC balance and address for the configured wallet.',
      {},
      async () => {
        if (!config.canPay) {
          return {
            content: [
              {
                type: 'text' as const,
                text: 'No wallet configured. Set STELLAR_SECRET or EVM_PRIVATE_KEY, or use create_wallet.'
              }
            ],
            isError: true
          }
        }
    
        try {
          const client = await clientCache.getClient(config.network, config)
          const balance = await client.getBalance()
          const address = client.getAddress()
    
          return {
            content: [
              {
                type: 'text' as const,
                text: JSON.stringify(
                  {
                    address,
                    balance: `${balance} USDC`,
                    network: config.network,
                    mode: config.mode
                  },
                  null,
                  2
                )
              }
            ]
          }
        } catch (err) {
          return {
            content: [
              {
                type: 'text' as const,
                text: `Error: ${err instanceof Error ? err.message : String(err)}`
              }
            ],
            isError: true
          }
        }
      }
    )
Behavior3/5

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

No annotations provided, so description carries full burden. Mentions 'configured wallet' indicating stateful dependency, but lacks disclosure of error behavior (what happens if unconfigured?), safety profile (read-only), or external dependencies.

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?

Single sentence with zero waste. Front-loaded with action verb and resource. Every word earns its place.

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?

Appropriately complete for a simple read operation with no output schema. Specifies currency (USDC) and that address is returned alongside balance. Could improve by noting error conditions.

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

Parameters4/5

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

Zero parameters present (baseline 4). Description compensates adequately by explaining the implicit operand ('the configured wallet'), clarifying why no arguments are required.

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?

Clear specific verb ('Check') and resource ('USDC balance and address'). States scope ('configured wallet'). Distinguishes implicitly from create_wallet but does not explicitly differentiate from spending_summary sibling.

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

Usage Guidelines2/5

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

Provides no explicit when-to-use guidance, prerequisites, or alternatives. While 'configured wallet' implies a dependency on prior wallet creation, it does not state this as a requirement or indicate when to use this versus spending_summary.

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

Install Server

Other Tools

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/402md/mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server