Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

get_cosmos_all_balances

Retrieve all token balances for any Cosmos SDK blockchain address across multiple networks. Query balances on chains like Osmosis, Juno, and Kava to monitor portfolio holdings.

Instructions

Get all token balances for a Cosmos SDK address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesCosmos address
blockchainYesBlockchain name (e.g., "osmosis", "juno", "kava")
networkNoNetwork type (defaults to mainnet)

Implementation Reference

  • Handler logic for get_cosmos_all_balances tool: extracts parameters, calls cosmosService.getAllBalances, and formats response.
    case 'get_cosmos_all_balances': { const blockchain = args?.blockchain as string; const address = args?.address as string; const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet'; const result = await cosmosService.getAllBalances(blockchain, address, network); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], isError: !result.success, }; }
  • Tool schema definition including name, description, and input schema for validation.
    { name: 'get_cosmos_all_balances', description: 'Get all token balances for a Cosmos SDK address', inputSchema: { type: 'object', properties: { blockchain: { type: 'string', description: 'Blockchain name (e.g., "osmosis", "juno", "kava")', }, address: { type: 'string', description: 'Cosmos address', }, network: { type: 'string', enum: ['mainnet', 'testnet'], description: 'Network type (defaults to mainnet)', }, }, required: ['blockchain', 'address'], }, },
  • Core implementation: constructs REST API URL for all balances endpoint and fetches data using internal fetchRest method.
    async getAllBalances( blockchain: string, address: string, network: 'mainnet' | 'testnet' = 'mainnet' ): Promise<EndpointResponse> { try { const baseUrl = this.getRestUrl(blockchain, network); const url = `${baseUrl}/cosmos/bank/v1beta1/balances/${address}`; return this.fetchRest(url); } catch (error) { return { success: false, error: error instanceof Error ? error.message : 'Failed to get Cosmos balances', }; } }

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/buildwithgrove/mcp-pocket'

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