Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

get_cosmos_block

Retrieve Cosmos blockchain block data at a specific height to analyze transactions, validate network activity, or inspect chain state using Grove's Pocket Network endpoints.

Instructions

Get Cosmos block at specific height

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blockchainYesBlockchain name
heightYesBlock height
networkNoNetwork type (defaults to mainnet)

Implementation Reference

  • Handler execution logic for the 'get_cosmos_block' tool: extracts parameters and delegates to CosmosService.getBlockByHeight
    case 'get_cosmos_block': { const blockchain = args?.blockchain as string; const height = args?.height as number; const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet'; const result = await cosmosService.getBlockByHeight(blockchain, height, network); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], isError: !result.success, }; }
  • Input schema definition for the 'get_cosmos_block' tool, specifying required blockchain and height parameters
    name: 'get_cosmos_block', description: 'Get Cosmos block at specific height', inputSchema: { type: 'object', properties: { blockchain: { type: 'string', description: 'Blockchain name', }, height: { type: 'number', description: 'Block height', }, network: { type: 'string', enum: ['mainnet', 'testnet'], description: 'Network type (defaults to mainnet)', }, }, required: ['blockchain', 'height'], },
  • src/index.ts:88-101 (registration)
    Registration of all tools including 'get_cosmos_block' via registerCosmosHandlers in the tools list used for ListToolsRequestHandler
    const tools: Tool[] = [ ...registerBlockchainHandlers(server, blockchainService), ...registerDomainHandlers(server, domainResolver), ...registerTransactionHandlers(server, advancedBlockchain), ...registerTokenHandlers(server, advancedBlockchain), ...registerMultichainHandlers(server, advancedBlockchain), ...registerContractHandlers(server, advancedBlockchain), ...registerUtilityHandlers(server, advancedBlockchain), ...registerEndpointHandlers(server, endpointManager), ...registerSolanaHandlers(server, solanaService), ...registerCosmosHandlers(server, cosmosService), ...registerSuiHandlers(server, suiService), ...registerDocsHandlers(server, docsManager), ];
  • Core helper method in CosmosService that fetches the specific Cosmos block by height using REST API
    async getBlockByHeight( blockchain: string, height: number, network: 'mainnet' | 'testnet' = 'mainnet' ): Promise<EndpointResponse> { try { const baseUrl = this.getRestUrl(blockchain, network); const url = `${baseUrl}/cosmos/base/tendermint/v1beta1/blocks/${height}`; return this.fetchRest(url); } catch (error) { return { success: false, error: error instanceof Error ? error.message : 'Failed to get Cosmos block', }; } }

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