get_cosmos_params
Retrieve Cosmos blockchain module parameters for staking, slashing, distribution, governance, and minting functions across mainnet and testnet networks.
Instructions
Get chain parameters for a Cosmos module
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| blockchain | Yes | Blockchain name | |
| module | Yes | Module to query parameters for | |
| network | No | Network type (defaults to mainnet) |
Implementation Reference
- src/handlers/cosmos-handlers.ts:649-665 (handler)Executes the get_cosmos_params tool by parsing arguments and delegating to CosmosService.getParamscase 'get_cosmos_params': { const blockchain = args?.blockchain as string; const module = args?.module as 'staking' | 'slashing' | 'distribution' | 'gov' | 'mint'; const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet'; const result = await cosmosService.getParams(blockchain, module, network); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], isError: !result.success, }; }
- Input schema and metadata definition for the get_cosmos_params tool{ name: 'get_cosmos_params', description: 'Get chain parameters for a Cosmos module', inputSchema: { type: 'object', properties: { blockchain: { type: 'string', description: 'Blockchain name', }, module: { type: 'string', enum: ['staking', 'slashing', 'distribution', 'gov', 'mint'], description: 'Module to query parameters for', }, network: { type: 'string', enum: ['mainnet', 'testnet'], description: 'Network type (defaults to mainnet)', }, }, required: ['blockchain', 'module'], }, },
- Core helper method that constructs the REST API URL and fetches module parameters from the Cosmos chainasync getParams( blockchain: string, module: 'staking' | 'slashing' | 'distribution' | 'gov' | 'mint', network: 'mainnet' | 'testnet' = 'mainnet' ): Promise<EndpointResponse> { try { const baseUrl = this.getRestUrl(blockchain, network); const url = `${baseUrl}/cosmos/${module}/v1beta1/params`; return this.fetchRest(url); } catch (error) { return { success: false, error: error instanceof Error ? error.message : 'Failed to get Cosmos params', }; } }
- src/index.ts:88-101 (registration)The cosmos tools, including get_cosmos_params, are registered by including registerCosmosHandlers in the global tools list for MCP tool discoveryconst 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), ];