Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

get_cosmos_proposal_votes

Retrieve all governance proposal votes across Cosmos blockchains to analyze community sentiment and voting patterns for informed decision-making.

Instructions

Get all votes for a governance proposal

Input Schema

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

Implementation Reference

  • Tool schema definition including name, description, and input schema for get_cosmos_proposal_votes in the registerCosmosHandlers function.
    { 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'], }, },
  • Handler logic in handleCosmosTool switch statement that extracts arguments and delegates to CosmosService.getProposalVotes, then formats the response.
    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 in CosmosService.getProposalVotes that constructs the Cosmos Gov REST API endpoint for proposal votes and performs the HTTP fetch.
    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