get_cosmos_balance
Retrieve Cosmos blockchain balance for any address across multiple chains like Osmosis, Juno, or Kava. Specify blockchain, address, and optional denomination to query token holdings.
Instructions
Get balance for a Cosmos SDK address on any Cosmos chain
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| blockchain | Yes | Blockchain name (e.g., "osmosis", "juno", "kava", "akash") | |
| address | Yes | Cosmos address | |
| denom | No | Optional: Specific denomination to query (e.g., "uosmo", "ujuno") | |
| network | No | Network type (defaults to mainnet) |
Implementation Reference
- src/handlers/cosmos-handlers.ts:385-402 (handler)The handler case for 'get_cosmos_balance' in handleCosmosTool function. Extracts input parameters, calls cosmosService.getBalance, and formats the response.case 'get_cosmos_balance': { const blockchain = args?.blockchain as string; const address = args?.address as string; const denom = args?.denom as string | undefined; const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet'; const result = await cosmosService.getBalance(blockchain, address, denom, network); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], isError: !result.success, }; }
- src/handlers/cosmos-handlers.ts:15-41 (registration)Tool registration in registerCosmosHandlers function, including name, description, and input schema definition.{ name: 'get_cosmos_balance', description: 'Get balance for a Cosmos SDK address on any Cosmos chain', inputSchema: { type: 'object', properties: { blockchain: { type: 'string', description: 'Blockchain name (e.g., "osmosis", "juno", "kava", "akash")', }, address: { type: 'string', description: 'Cosmos address', }, denom: { type: 'string', description: 'Optional: Specific denomination to query (e.g., "uosmo", "ujuno")', }, network: { type: 'string', enum: ['mainnet', 'testnet'], description: 'Network type (defaults to mainnet)', }, }, required: ['blockchain', 'address'], }, },
- Input schema for the get_cosmos_balance tool, defining parameters like blockchain, address, denom, and network.inputSchema: { type: 'object', properties: { blockchain: { type: 'string', description: 'Blockchain name (e.g., "osmosis", "juno", "kava", "akash")', }, address: { type: 'string', description: 'Cosmos address', }, denom: { type: 'string', description: 'Optional: Specific denomination to query (e.g., "uosmo", "ujuno")', }, network: { type: 'string', enum: ['mainnet', 'testnet'], description: 'Network type (defaults to mainnet)', }, }, required: ['blockchain', 'address'], },