Skip to main content
Glama

get_major_crypto_prices

Retrieve current market data for major cryptocurrencies including prices, market cap, trading volume, and price changes.

Instructions

Get comprehensive market data including prices, market capitalization, 24h trading volume, and 24h price changes for major cryptocurrencies (BTC, ETH)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The actual implementation of fetching and filtering major crypto prices.
    export const getMajorCryptoPrices = async () => {
        try {
            const allPricesResult = await getAllPrices();
            
            if (!allPricesResult.success) {
                return allPricesResult;
            }
    
            // Major cryptocurrencies
            const majorCryptoSymbols = ['BTC', 'ETH'];
            
            const cryptoPrices = (allPricesResult.prices || []).filter((price: any) => 
                majorCryptoSymbols.includes(price.symbol)
            );
    
            return {
                success: true,
                prices: cryptoPrices,
                count: cryptoPrices.length,
                category: 'major_crypto'
            };
        } catch (error: any) {
            console.error('Error fetching major crypto prices:', error);
            return {
                success: false,
                error: error.message || 'Failed to fetch major crypto prices'
            };
        }
    };
  • The registration of the 'get_major_crypto_prices' tool within the MCP framework.
    export const GetMajorCryptoPricesTool: McpTool = {
        name: "get_major_crypto_prices",
        description: "Get comprehensive market data including prices, market capitalization, 24h trading volume, and 24h price changes for major cryptocurrencies (BTC, ETH)",
        schema: {},
        handler: async (agent: WalletAgent, input: Record<string, any>) => {
            const result = await getMajorCryptoPrices();
    
            if (!result.success) {
                return {
                    status: "error",
                    message: (result as any).error
                };
            }
    
            const successResult = result as any;
            return {
                status: "success",
                prices: successResult.prices,
                count: successResult.count,
                category: successResult.category,
                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