Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

get_cosmos_transaction

Retrieve Cosmos blockchain transaction details using transaction hash to inspect transaction data, verify transfers, and analyze on-chain activity across mainnet and testnet networks.

Instructions

Get Cosmos transaction by hash

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
blockchainYesBlockchain name
networkNoNetwork type (defaults to mainnet)
txHashYesTransaction hash

Implementation Reference

  • Handler case in handleCosmosTool that extracts input parameters, calls CosmosService.getTransaction, and formats the response for the MCP tool execution.
    case 'get_cosmos_transaction': { const blockchain = args?.blockchain as string; const txHash = args?.txHash as string; const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet'; const result = await cosmosService.getTransaction(blockchain, txHash, network); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], isError: !result.success, }; }
  • Tool definition including name, description, and input schema for validating parameters in the MCP tool registry.
    name: 'get_cosmos_transaction', description: 'Get Cosmos transaction by hash', inputSchema: { type: 'object', properties: { blockchain: { type: 'string', description: 'Blockchain name', }, txHash: { type: 'string', description: 'Transaction hash', }, network: { type: 'string', enum: ['mainnet', 'testnet'], description: 'Network type (defaults to mainnet)', }, }, required: ['blockchain', 'txHash'], }, },
  • src/index.ts:88-101 (registration)
    Registers all tools with the MCP server by collecting Tool objects from various handler modules, including Cosmos tools containing get_cosmos_transaction.
    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 service method that constructs the Cosmos REST API URL for transaction lookup and fetches the data using the internal fetchRest helper.
    async getTransaction( blockchain: string, txHash: string, network: 'mainnet' | 'testnet' = 'mainnet' ): Promise<EndpointResponse> { try { const baseUrl = this.getRestUrl(blockchain, network); const url = `${baseUrl}/cosmos/tx/v1beta1/txs/${txHash}`; return this.fetchRest(url); } catch (error) { return { success: false, error: error instanceof Error ? error.message : 'Failed to get Cosmos transaction', }; } }

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