Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

get_cosmos_all_balances

Retrieve all token balances for a Cosmos SDK address across multiple blockchains using Grove's MCP Server for Pocket Network.

Instructions

Get all token balances for a Cosmos SDK address

Input Schema

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

Implementation Reference

  • MCP tool handler case that parses input arguments, calls the service method, and formats the 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 registration definition including name, description, and input schema used by registerCosmosHandlers.
    {
      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'],
      },
    },
  • Service method implementing the core logic: constructs Cosmos REST API URL for all balances and fetches data.
    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',
        };
      }
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It states a read operation ('Get'), implying it's non-destructive, but lacks details on rate limits, authentication needs, error conditions, or what 'all token balances' entails (e.g., native vs. IBC tokens, pagination). This leaves significant gaps for a tool with potential complexity.

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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse quickly. Every part of the sentence earns its place by conveying essential information.

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?

Given no annotations and no output schema, the description is incomplete for a tool that likely returns complex balance data. It doesn't explain the return format (e.g., list of tokens with amounts), potential limitations, or how it differs from simpler balance tools. For a 'get all' operation in a blockchain context, more context is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents all three parameters (blockchain, address, network). The description adds no additional parameter semantics beyond what's in the schema, such as format examples for 'address' or clarifications on 'blockchain' values. This meets the baseline for high schema coverage.

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 verb ('Get') and resource ('all token balances for a Cosmos SDK address'), making the purpose specific and understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_cosmos_balance' or 'compare_balances', which might offer similar functionality with different scopes.

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 on when to use this tool versus alternatives. Given sibling tools like 'get_cosmos_balance' (likely for single token balances) and 'compare_balances', an agent would have no indication of when this 'all balances' tool is preferred or what distinguishes it from other balance-related tools.

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

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