get_cosmos_proposals
Retrieve governance proposals from Cosmos blockchains to track voting status, monitor active discussions, and analyze community decisions across networks.
Instructions
Get governance proposals on a Cosmos chain
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| blockchain | Yes | Blockchain name | |
| network | No | Network type (defaults to mainnet) | |
| status | No | Optional: Filter by proposal status |
Implementation Reference
- src/services/cosmos-service.ts:274-291 (handler)Core handler implementation that constructs the REST API URL for Cosmos governance proposals and fetches the data.async getProposals( blockchain: string, status?: 'deposit_period' | 'voting_period' | 'passed' | 'rejected' | 'failed', network: 'mainnet' | 'testnet' = 'mainnet' ): Promise<EndpointResponse> { try { const baseUrl = this.getRestUrl(blockchain, network); const statusFilter = status ? `?proposal_status=${status}` : ''; const url = `${baseUrl}/cosmos/gov/v1beta1/proposals${statusFilter}`; return this.fetchRest(url); } catch (error) { return { success: false, error: error instanceof Error ? error.message : 'Failed to get Cosmos proposals', }; } }
- src/handlers/cosmos-handlers.ts:554-576 (handler)MCP tool dispatcher handler that parses input arguments and calls the CosmosService.getProposals method.case 'get_cosmos_proposals': { const blockchain = args?.blockchain as string; const status = args?.status as | 'deposit_period' | 'voting_period' | 'passed' | 'rejected' | 'failed' | undefined; const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet'; const result = await cosmosService.getProposals(blockchain, status, network); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], isError: !result.success, }; }
- src/handlers/cosmos-handlers.ts:232-255 (registration)Tool registration in the registerCosmosHandlers function, defining name, description, and input schema.{ 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'], }, },
- src/index.ts:97-101 (registration)Registration of cosmos tools to the MCP server by including in the tools list used for ListToolsRequestHandler....registerSolanaHandlers(server, solanaService), ...registerCosmosHandlers(server, cosmosService), ...registerSuiHandlers(server, suiService), ...registerDocsHandlers(server, docsManager), ];