get_balance
Retrieve current wallet balance across multiple blockchain networks, with optional currency conversion for financial tracking and management.
Instructions
Get the current balance of the wallet.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| network | No | Query balance for specific network (e.g., "polygon-mainnet" or CAIP-2 "eip155:137"). Use "all" for all networks. Required for EVM wallets; auto-resolved for Solana. | |
| display_currency | No | Display currency for balance conversion (e.g. KRW, EUR). Defaults to server setting. | |
| wallet_id | No | Target wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet. |
Implementation Reference
- The handler function for the get_balance MCP tool, which calls the API to retrieve wallet balances.
async (args) => { const params = new URLSearchParams(); if (args.network) params.set('network', args.network); if (args.display_currency) params.set('display_currency', args.display_currency); if (args.wallet_id) params.set('walletId', args.wallet_id); const qs = params.toString(); const result = await apiClient.get('/v1/wallet/balance' + (qs ? '?' + qs : '')); return toToolResult(result); }, ); - packages/mcp/src/tools/get-balance.ts:10-29 (registration)Registration function for the get_balance MCP tool.
export function registerGetBalance(server: McpServer, apiClient: ApiClient, walletContext?: WalletContext): void { server.tool( 'get_balance', withWalletPrefix('Get the current balance of the wallet.', walletContext?.walletName), { network: z.string().optional().describe('Query balance for specific network (e.g., "polygon-mainnet" or CAIP-2 "eip155:137"). Use "all" for all networks. Required for EVM wallets; auto-resolved for Solana.'), display_currency: z.string().optional().describe('Display currency for balance conversion (e.g. KRW, EUR). Defaults to server setting.'), wallet_id: z.string().optional().describe('Target wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet.'), }, async (args) => { const params = new URLSearchParams(); if (args.network) params.set('network', args.network); if (args.display_currency) params.set('display_currency', args.display_currency); if (args.wallet_id) params.set('walletId', args.wallet_id); const qs = params.toString(); const result = await apiClient.get('/v1/wallet/balance' + (qs ? '?' + qs : '')); return toToolResult(result); }, ); }