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',
        };
      }
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states it's a read operation ('Get'), implying it's likely non-destructive, but doesn't clarify authentication requirements, rate limits, error conditions, or what the return format looks like (e.g., JSON structure). For a tool with no annotation coverage, this leaves significant gaps in understanding how it behaves.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with zero wasted words. It's front-loaded with the core purpose and efficiently specifies the key constraint ('at specific height'). Every word earns its place, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (fetching blockchain data), lack of annotations, and no output schema, the description is minimally adequate but incomplete. It covers the basic purpose but misses behavioral details (e.g., error handling, return format) and usage context. The high schema coverage helps, but more guidance is needed for safe and effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description adds no additional parameter semantics beyond implying 'height' is required (which the schema already states). This meets the baseline of 3 where the schema does the heavy lifting, but the description doesn't enhance understanding of parameter interactions or constraints.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Get') and resource ('Cosmos block') with a specific qualifier ('at specific height'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_block_details' or 'get_cosmos_latest_block', which could cause confusion about when to use this specific tool versus alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_cosmos_latest_block' (for the most recent block) or 'get_block_details' (which might be more general). It also doesn't mention prerequisites or context for usage, leaving the agent to infer based on parameter names alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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