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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/price-api/price.ts:140-168 (handler)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' }; } }; - src/mcp/price-api/price_tools.ts:89-112 (registration)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() }; }, };