get_all_prices
Retrieve comprehensive market data for all tokens in the KAIA ecosystem, including prices, market capitalization, trading volume, and price changes from the KiloLend price API.
Instructions
Get comprehensive market data including prices, market capitalization, 24h trading volume, and 24h price changes for all available tokens from the KiloLend price API (KAIA ecosystem tokens and major cryptocurrencies)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/price-api/price.ts:42-67 (handler)The core logic implementation of get_all_prices, which fetches and maps price data.
export const getAllPrices = async () => { try { const response = await axios.get(PRICE_API_URL); if (response.data.success) { // Map API symbols to standard symbols for better user experience const mappedPrices = mapApiResponse(response.data.data); return { success: true, prices: mappedPrices, count: response.data.count }; } else { return { success: false, error: 'API returned unsuccessful response' }; } } catch (error: any) { console.error('Error fetching all prices:', error); return { success: false, error: error.message || 'Failed to fetch prices from API' }; } }; - src/mcp/price-api/price_tools.ts:11-33 (registration)The MCP tool registration and handler wrapper for "get_all_prices".
export const GetAllPricesTool: McpTool = { name: "get_all_prices", description: "Get comprehensive market data including prices, market capitalization, 24h trading volume, and 24h price changes for all available tokens from the KiloLend price API (KAIA ecosystem tokens and major cryptocurrencies)", schema: {}, handler: async (agent: WalletAgent, input: Record<string, any>) => { const result = await getAllPrices(); if (!result.success) { return { status: "error", message: (result as any).error }; } // Each price object contains: symbol, price, percent_change_24h, market_cap, volume_24h, last_updated, timestamp return { status: "success", prices: result.prices, count: result.count, timestamp: new Date().toISOString() }; }, };