Skip to main content
Glama

get_balance

Retrieve total wallet balance from MCP Money server to monitor cryptocurrency holdings via Nostr and Cashu protocols.

Instructions

Get the total wallet balance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler function in MCPWallet class that executes the get_balance tool logic by retrieving and returning the total wallet balance in satoshis from the NDKCashuWallet instance.
    async getBalance(): Promise<number> {
      if (!this.wallet) throw new Error('Wallet not initialized');
    
      try {
        const balance = this.wallet.balance?.amount || 0;
        return balance;
      } catch (error) {
        console.error('Error getting balance:', error);
        return 0;
      }
    }
  • wallet.ts:531-539 (registration)
    Registration of the get_balance tool in the MCP server's listTools handler, defining its name, description, and input schema (no required parameters).
    {
      name: 'get_balance',
      description: 'Get the total wallet balance',
      inputSchema: {
        type: 'object',
        properties: {},
        required: []
      }
    },
  • MCP tool dispatch handler in MCPServer.callTool method that handles 'get_balance' calls by invoking the wallet's getBalance() and formatting the MCP response.
    case 'get_balance':
      const balance = await this.wallet.getBalance();
      return { content: [{ type: 'text', text: `Total balance: ${balance} sats` }] };
  • wallet.ts:752-754 (registration)
    CLI command registration for 'get_balance' in the main function's switch statement, which calls the wallet handler.
    case 'get_balance':
      await wallet.getBalance();
      break;
  • Help text description for the get_balance command in CLI usage.
    console.log('  get_balance - Get total wallet balance');
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Get' implies a read operation, it doesn't specify whether this requires authentication, has rate limits, returns real-time vs cached data, or what format the balance is returned in. The description is too minimal for a tool with zero annotation coverage.

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?

The description is perfectly concise - a single clear sentence that communicates the essential purpose without any wasted words. It's front-loaded with the core functionality and doesn't contain unnecessary elaboration.

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

Completeness2/5

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

For a tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what 'total wallet balance' means (aggregated across all assets? specific currency?), what format the response will be in, or any behavioral characteristics. The agent would be left guessing about important operational details.

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?

The tool has zero parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't waste space discussing nonexistent parameters, though it could optionally mention that no parameters 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?

The description clearly states the action ('Get') and resource ('total wallet balance'), making the tool's purpose immediately understandable. However, it doesn't differentiate from sibling tools like 'get_mint_balances' which suggests there might be multiple balance-related tools without clear distinction.

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?

The description provides no guidance about when to use this tool versus alternatives like 'get_mint_balances' or other sibling tools. There's no mention of prerequisites, context, or comparison with related tools, leaving the agent with insufficient usage direction.

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/pablof7z/mcp-money'

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