get_cosmos_params
Retrieve chain parameters for Cosmos modules like staking, slashing, distribution, governance, and minting across blockchain 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
- Tool definition including name, description, and input schema validation for get_cosmos_params.{ 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'], }, },
- src/handlers/cosmos-handlers.ts:649-665 (handler)Handler case in handleCosmosTool that processes arguments and calls the service implementation.case '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, }; }
- Core service method that constructs the REST API URL and fetches the module parameters from the Cosmos chain.async 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', }; } }