Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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'
            };
        }
    };
  • 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()
            };
        },
    };

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/tamago-labs/kaia-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server