Skip to main content
Glama
buildwithgrove

Grove Public Endpoints MCP Server

Official

get_cosmos_proposals

Retrieve governance proposals for Cosmos blockchains, allowing users to filter by status and network to monitor and analyze chain governance activities.

Instructions

Get governance proposals on a Cosmos chain

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blockchainYesBlockchain name
statusNoOptional: Filter by proposal status
networkNoNetwork type (defaults to mainnet)

Implementation Reference

  • MCP tool handler that extracts arguments (blockchain, status, network) and calls CosmosService.getProposals to fetch and return governance proposals.
    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,
      };
    }
  • Tool registration definition including name, description, and input schema for get_cosmos_proposals.
    {
      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'],
      },
    },
  • Input schema defining parameters for the get_cosmos_proposals tool.
    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'],
    },
  • Core helper method in CosmosService that constructs the REST API URL for 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',
        };
      }
    }

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'

If you have feedback or need assistance with the MCP directory API, please join our Discord server