Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

get_cosmos_proposal_votes

Retrieve all votes for a Cosmos governance proposal to analyze community participation and decision outcomes across blockchain networks.

Instructions

Get all votes for a governance proposal

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blockchainYesBlockchain name
proposalIdYesProposal ID
networkNoNetwork type (defaults to mainnet)

Implementation Reference

  • Tool registration including name, description, and input schema for get_cosmos_proposal_votes
    {
      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'],
      },
    },
  • MCP tool handler case that extracts arguments and delegates to CosmosService.getProposalVotes
    case 'get_cosmos_proposal_votes': {
      const blockchain = args?.blockchain as string;
      const proposalId = args?.proposalId as number;
      const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet';
    
      const result = await cosmosService.getProposalVotes(blockchain, proposalId, network);
    
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
        isError: !result.success,
      };
    }
  • Core implementation: fetches votes from Cosmos governance REST API endpoint
    async getProposalVotes(
      blockchain: string,
      proposalId: number,
      network: 'mainnet' | 'testnet' = 'mainnet'
    ): Promise<EndpointResponse> {
      try {
        const baseUrl = this.getRestUrl(blockchain, network);
        const url = `${baseUrl}/cosmos/gov/v1beta1/proposals/${proposalId}/votes`;
    
        return this.fetchRest(url);
      } catch (error) {
        return {
          success: false,
          error: error instanceof Error ? error.message : 'Failed to get Cosmos proposal votes',
        };
      }
    }

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