crypto_trending
Identify top trending cryptocurrencies by retrieving the 7 most popular assets from CoinGecko for market analysis and investment research.
Instructions
Get top 7 trending cryptocurrencies on CoinGecko
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/modules/crypto.ts:17-27 (handler)The handler for the 'crypto_trending' tool, which fetches data from the CoinGecko API and formats it into a Markdown table.
server.tool("crypto_trending", "Get top 7 trending cryptocurrencies on CoinGecko", {}, async () => { const data = await safeFetch("https://api.coingecko.com/api/v3/search/trending"); const coins = data.coins.slice(0, 7); const rows = coins.map((c: any, i: number) => [ `${i + 1}`, c.item.name, c.item.symbol.toUpperCase(), `#${c.item.market_cap_rank || "N/A"}`, formatCurrency(c.item.data?.price || 0), formatPercent(c.item.data?.price_change_percentage_24h?.usd || 0) ]); return { content: [{ type: "text", text: `**Trending Coins**\n${mdTable(["#", "Name", "Symbol", "Rank", "Price", "24h"], rows)}` }] }; });