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
| Name | Required | Description | Default |
|---|---|---|---|
| blockchain | Yes | Blockchain name | |
| network | No | Network type (defaults to mainnet) | |
| proposalId | Yes | Proposal 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'], }, },
- src/handlers/cosmos-handlers.ts:596-612 (handler)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', }; } }