get_cosmos_account
Retrieve Cosmos blockchain account details including sequence numbers and account information for transaction processing and wallet management.
Instructions
Get Cosmos account information (sequence, account number)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | Cosmos address | |
| blockchain | Yes | Blockchain name | |
| network | No | Network type (defaults to mainnet) |
Implementation Reference
- Tool schema definition including name, description, and input validation schema.{ name: 'get_cosmos_account', description: 'Get Cosmos account information (sequence, account number)', inputSchema: { type: 'object', properties: { blockchain: { type: 'string', description: 'Blockchain name', }, address: { type: 'string', description: 'Cosmos address', }, network: { type: 'string', enum: ['mainnet', 'testnet'], description: 'Network type (defaults to mainnet)', }, }, required: ['blockchain', 'address'], }, },
- src/handlers/cosmos-handlers.ts:422-438 (handler)Executes the tool by calling cosmosService.getAccount and formatting the response.case 'get_cosmos_account': { const blockchain = args?.blockchain as string; const address = args?.address as string; const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet'; const result = await cosmosService.getAccount(blockchain, address, network); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], isError: !result.success, }; }
- Core implementation: constructs REST API URL and fetches account data from Cosmos node.async getAccount( blockchain: string, address: string, network: 'mainnet' | 'testnet' = 'mainnet' ): Promise<EndpointResponse> { try { const baseUrl = this.getRestUrl(blockchain, network); const url = `${baseUrl}/cosmos/auth/v1beta1/accounts/${address}`; return this.fetchRest(url); } catch (error) { return { success: false, error: error instanceof Error ? error.message : 'Failed to get Cosmos account', }; } }
- src/index.ts:98-101 (registration)Registers cosmos tools (including schema) by calling registerCosmosHandlers and including in the tools list for MCP server....registerCosmosHandlers(server, cosmosService), ...registerSuiHandlers(server, suiService), ...registerDocsHandlers(server, docsManager), ];
- src/index.ts:124-126 (registration)Dispatches tool calls to handleCosmosTool based on tool name.(await handleCosmosTool(name, args, cosmosService)) || (await handleSuiTool(name, args, suiService)) || (await handleDocsTool(name, args, docsManager));