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
| Name | Required | Description | Default |
|---|---|---|---|
| blockchain | Yes | Blockchain name | |
| validatorAddress | Yes | Validator address | |
| network | No | Network type (defaults to mainnet) |
Implementation Reference
- src/handlers/cosmos-handlers.ts:476-492 (handler)MCP tool handler that extracts parameters from tool arguments and calls CosmosService.getValidator to execute the tool logiccase '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 endpointasync 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', }; } }