Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

get_cosmos_validator

Retrieve validator details for Cosmos-based blockchains using Grove's MCP Server for Pocket Network. Provide blockchain name and validator address to access specific validator information.

Instructions

Get specific validator details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blockchainYesBlockchain name
validatorAddressYesValidator address
networkNoNetwork type (defaults to mainnet)

Implementation Reference

  • MCP tool handler that extracts parameters from tool arguments and calls CosmosService.getValidator to execute the tool logic
    case 'get_cosmos_validator': { const blockchain = args?.blockchain as string; const validatorAddress = args?.validatorAddress as string; const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet'; const result = await cosmosService.getValidator(blockchain, validatorAddress, network); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], isError: !result.success, }; }
  • Input schema definition for the get_cosmos_validator tool, specifying parameters like blockchain, validatorAddress, and optional network
    { name: 'get_cosmos_validator', description: 'Get specific validator details', inputSchema: { type: 'object', properties: { blockchain: { type: 'string', description: 'Blockchain name', }, validatorAddress: { type: 'string', description: 'Validator address', }, network: { type: 'string', enum: ['mainnet', 'testnet'], description: 'Network type (defaults to mainnet)', }, }, required: ['blockchain', 'validatorAddress'], }, },
  • src/index.ts:98-98 (registration)
    Registers the Cosmos tools (including get_cosmos_validator) by including the result of registerCosmosHandlers in the server's tool list for ListToolsRequest
    ...registerCosmosHandlers(server, cosmosService),
  • Core helper function that constructs the REST API URL and fetches specific validator details from the Cosmos staking endpoint
    async getValidator( blockchain: string, validatorAddress: string, network: 'mainnet' | 'testnet' = 'mainnet' ): Promise<EndpointResponse> { try { const baseUrl = this.getRestUrl(blockchain, network); const url = `${baseUrl}/cosmos/staking/v1beta1/validators/${validatorAddress}`; return this.fetchRest(url); } catch (error) { return { success: false, error: error instanceof Error ? error.message : 'Failed to get Cosmos validator', }; } }

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