Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

get_cosmos_rewards

Retrieve staking rewards for Cosmos delegators by specifying blockchain, delegator address, and optional validator. Supports mainnet and testnet networks.

Instructions

Get staking rewards for a delegator

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blockchainYesBlockchain name
delegatorAddressYesDelegator address
validatorAddressNoOptional: Specific validator address
networkNoNetwork type (defaults to mainnet)

Implementation Reference

  • Input schema and tool metadata definition for 'get_cosmos_rewards' tool.
    {
      name: 'get_cosmos_rewards',
      description: 'Get staking rewards for a delegator',
      inputSchema: {
        type: 'object',
        properties: {
          blockchain: {
            type: 'string',
            description: 'Blockchain name',
          },
          delegatorAddress: {
            type: 'string',
            description: 'Delegator address',
          },
          validatorAddress: {
            type: 'string',
            description: 'Optional: Specific validator address',
          },
          network: {
            type: 'string',
            enum: ['mainnet', 'testnet'],
            description: 'Network type (defaults to mainnet)',
          },
        },
        required: ['blockchain', 'delegatorAddress'],
      },
    },
  • MCP tool handler case for 'get_cosmos_rewards': extracts args, calls service, returns formatted response.
    case 'get_cosmos_rewards': {
      const blockchain = args?.blockchain as string;
      const delegatorAddress = args?.delegatorAddress as string;
      const validatorAddress = args?.validatorAddress as string | undefined;
      const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet';
    
      const result = await cosmosService.getRewards(
        blockchain,
        delegatorAddress,
        validatorAddress,
        network
      );
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
        isError: !result.success,
      };
    }
  • Core helper method: Builds and fetches Cosmos REST API endpoint for delegator rewards.
    async getRewards(
      blockchain: string,
      delegatorAddress: string,
      validatorAddress?: string,
      network: 'mainnet' | 'testnet' = 'mainnet'
    ): Promise<EndpointResponse> {
      try {
        const baseUrl = this.getRestUrl(blockchain, network);
        const url = validatorAddress
          ? `${baseUrl}/cosmos/distribution/v1beta1/delegators/${delegatorAddress}/rewards/${validatorAddress}`
          : `${baseUrl}/cosmos/distribution/v1beta1/delegators/${delegatorAddress}/rewards`;
    
        return this.fetchRest(url);
      } catch (error) {
        return {
          success: false,
          error: error instanceof Error ? error.message : 'Failed to get Cosmos rewards',
        };
      }
    }
  • Function that defines and returns all Cosmos tools array for registration with MCP server, including 'get_cosmos_rewards'.
    export function registerCosmosHandlers(
      server: Server,
      cosmosService: CosmosService
    ): Tool[] {
      const tools: Tool[] = [
        {
          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'],
          },
        },
        {
          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'],
          },
        },
        {
          name: 'get_cosmos_account',
          description: 'Get Cosmos account information (sequence, account number)',
          inputSchema: {
            type: 'object',
            properties: {
              blockchain: {
                type: 'string',
                description: 'Blockchain name',
              },
              address: {
                type: 'string',
                description: 'Cosmos address',
              },
              network: {
                type: 'string',
                enum: ['mainnet', 'testnet'],
                description: 'Network type (defaults to mainnet)',
              },
            },
            required: ['blockchain', 'address'],
          },
        },
        {
          name: 'get_cosmos_delegations',
          description: 'Get all staking delegations for a Cosmos address',
          inputSchema: {
            type: 'object',
            properties: {
              blockchain: {
                type: 'string',
                description: 'Blockchain name',
              },
              delegatorAddress: {
                type: 'string',
                description: 'Delegator address',
              },
              network: {
                type: 'string',
                enum: ['mainnet', 'testnet'],
                description: 'Network type (defaults to mainnet)',
              },
            },
            required: ['blockchain', 'delegatorAddress'],
          },
        },
        {
          name: 'get_cosmos_validators',
          description: 'Get list of validators on a Cosmos chain',
          inputSchema: {
            type: 'object',
            properties: {
              blockchain: {
                type: 'string',
                description: 'Blockchain name',
              },
              status: {
                type: 'string',
                enum: ['bonded', 'unbonded', 'unbonding', 'all'],
                description: 'Validator status filter (defaults to bonded)',
              },
              network: {
                type: 'string',
                enum: ['mainnet', 'testnet'],
                description: 'Network type (defaults to mainnet)',
              },
            },
            required: ['blockchain'],
          },
        },
        {
          name: 'get_cosmos_validator',
          description: 'Get specific validator details',
          inputSchema: {
            type: 'object',
            properties: {
              blockchain: {
                type: 'string',
                description: 'Blockchain name',
              },
              validatorAddress: {
                type: 'string',
                description: 'Validator address',
              },
              network: {
                type: 'string',
                enum: ['mainnet', 'testnet'],
                description: 'Network type (defaults to mainnet)',
              },
            },
            required: ['blockchain', 'validatorAddress'],
          },
        },
        {
          name: 'get_cosmos_rewards',
          description: 'Get staking rewards for a delegator',
          inputSchema: {
            type: 'object',
            properties: {
              blockchain: {
                type: 'string',
                description: 'Blockchain name',
              },
              delegatorAddress: {
                type: 'string',
                description: 'Delegator address',
              },
              validatorAddress: {
                type: 'string',
                description: 'Optional: Specific validator address',
              },
              network: {
                type: 'string',
                enum: ['mainnet', 'testnet'],
                description: 'Network type (defaults to mainnet)',
              },
            },
            required: ['blockchain', 'delegatorAddress'],
          },
        },
        {
          name: 'get_cosmos_transaction',
          description: 'Get Cosmos transaction by hash',
          inputSchema: {
            type: 'object',
            properties: {
              blockchain: {
                type: 'string',
                description: 'Blockchain name',
              },
              txHash: {
                type: 'string',
                description: 'Transaction hash',
              },
              network: {
                type: 'string',
                enum: ['mainnet', 'testnet'],
                description: 'Network type (defaults to mainnet)',
              },
            },
            required: ['blockchain', 'txHash'],
          },
        },
        {
          name: 'search_cosmos_transactions',
          description: 'Search Cosmos transactions by events',
          inputSchema: {
            type: 'object',
            properties: {
              blockchain: {
                type: 'string',
                description: 'Blockchain name',
              },
              events: {
                type: 'array',
                items: { type: 'string' },
                description: 'Event filters (e.g., ["message.sender=cosmos1...", "transfer.amount=1000uosmo"])',
              },
              network: {
                type: 'string',
                enum: ['mainnet', 'testnet'],
                description: 'Network type (defaults to mainnet)',
              },
            },
            required: ['blockchain', 'events'],
          },
        },
        {
          name: 'get_cosmos_proposals',
          description: 'Get governance proposals on a Cosmos chain',
          inputSchema: {
            type: 'object',
            properties: {
              blockchain: {
                type: 'string',
                description: 'Blockchain name',
              },
              status: {
                type: 'string',
                enum: ['deposit_period', 'voting_period', 'passed', 'rejected', 'failed'],
                description: 'Optional: Filter by proposal status',
              },
              network: {
                type: 'string',
                enum: ['mainnet', 'testnet'],
                description: 'Network type (defaults to mainnet)',
              },
            },
            required: ['blockchain'],
          },
        },
        {
          name: 'get_cosmos_proposal',
          description: 'Get specific governance proposal details',
          inputSchema: {
            type: 'object',
            properties: {
              blockchain: {
                type: 'string',
                description: 'Blockchain name',
              },
              proposalId: {
                type: 'number',
                description: 'Proposal ID',
              },
              network: {
                type: 'string',
                enum: ['mainnet', 'testnet'],
                description: 'Network type (defaults to mainnet)',
              },
            },
            required: ['blockchain', 'proposalId'],
          },
        },
        {
          name: 'get_cosmos_proposal_votes',
          description: 'Get all votes for a governance proposal',
          inputSchema: {
            type: 'object',
            properties: {
              blockchain: {
                type: 'string',
                description: 'Blockchain name',
              },
              proposalId: {
                type: 'number',
                description: 'Proposal ID',
              },
              network: {
                type: 'string',
                enum: ['mainnet', 'testnet'],
                description: 'Network type (defaults to mainnet)',
              },
            },
            required: ['blockchain', 'proposalId'],
          },
        },
        {
          name: 'get_cosmos_latest_block',
          description: 'Get latest block information on a Cosmos chain',
          inputSchema: {
            type: 'object',
            properties: {
              blockchain: {
                type: 'string',
                description: 'Blockchain name',
              },
              network: {
                type: 'string',
                enum: ['mainnet', 'testnet'],
                description: 'Network type (defaults to mainnet)',
              },
            },
            required: ['blockchain'],
          },
        },
        {
          name: 'get_cosmos_block',
          description: 'Get Cosmos block at specific height',
          inputSchema: {
            type: 'object',
            properties: {
              blockchain: {
                type: 'string',
                description: 'Blockchain name',
              },
              height: {
                type: 'number',
                description: 'Block height',
              },
              network: {
                type: 'string',
                enum: ['mainnet', 'testnet'],
                description: 'Network type (defaults to mainnet)',
              },
            },
            required: ['blockchain', 'height'],
          },
        },
        {
          name: 'get_cosmos_params',
          description: 'Get chain parameters for a Cosmos module',
          inputSchema: {
            type: 'object',
            properties: {
              blockchain: {
                type: 'string',
                description: 'Blockchain name',
              },
              module: {
                type: 'string',
                enum: ['staking', 'slashing', 'distribution', 'gov', 'mint'],
                description: 'Module to query parameters for',
              },
              network: {
                type: 'string',
                enum: ['mainnet', 'testnet'],
                description: 'Network type (defaults to mainnet)',
              },
            },
            required: ['blockchain', 'module'],
          },
        },
      ];
    
      return tools;
    }
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. It states a read operation ('Get') but doesn't disclose behavioral traits like rate limits, authentication needs, error conditions, or what the return format looks like (especially critical without an output schema). This leaves significant gaps for agent understanding.

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 with zero wasted words. It's front-loaded with the core purpose and appropriately sized for a straightforward tool.

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. It doesn't explain what 'rewards' entail (e.g., amounts, periods, currency), how results are structured, or any behavioral constraints. For a tool with 4 parameters in a complex blockchain context, this lacks necessary context.

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 already documents all parameters thoroughly. The description adds no additional meaning about parameters beyond implying 'delegator' context. Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('staking rewards for a delegator'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'get_cosmos_delegations' or 'get_cosmos_balance', but the specificity about 'rewards' provides some implicit distinction.

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?

No guidance is provided on when to use this tool versus alternatives. With many sibling tools in the Cosmos ecosystem (e.g., get_cosmos_delegations, get_cosmos_balance), the description offers no context about prerequisites, timing, or comparative use cases.

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