Skip to main content
Glama

get_mint_balances

Retrieve detailed balance breakdowns by mint for managing digital assets through the MCP Money server.

Instructions

Get balance breakdown per mint

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler function in MCPWallet class that retrieves mint balances from the NDKCashuWallet instance and returns them as a Map.
    async getMintBalances(): Promise<Map<string, number>> { if (!this.wallet) throw new Error('Wallet not initialized'); try { const balances = this.wallet.mintBalances; let total = 0; const balanceMap = new Map<string, number>(); for (const [mintUrl, balance] of Object.entries(balances)) { balanceMap.set(mintUrl, balance); total += balance; } return balanceMap; } catch (error) { console.error('Error getting mint balances:', error); return new Map(); } }
  • MCP server tool call handler that invokes wallet.getMintBalances() and formats the response as text for MCP protocol.
    case 'get_mint_balances': const balances = await this.wallet.getMintBalances(); let balanceText = 'Balance per mint:\n'; let total = 0; for (const [mintUrl, balance] of balances) { balanceText += ` ${mintUrl}: ${balance} sats\n`; total += balance; } balanceText += `Total: ${total} sats`; return { content: [{ type: 'text', text: balanceText }] };
  • wallet.ts:540-548 (registration)
    Registration of the get_mint_balances tool in the static tools list returned by listTools handler.
    { name: 'get_mint_balances', description: 'Get balance breakdown per mint', inputSchema: { type: 'object', properties: {}, required: [] } },
  • Input schema for the get_mint_balances tool, defining an empty object with no required properties.
    inputSchema: { type: 'object', properties: {}, required: [] }

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