Skip to main content
Glama

get_trending_crypto

Retrieve top trending cryptocurrencies from the last 24 hours to identify market movements and inform trading decisions.

Instructions

Gets the top trending cryptocurrencies in the last 24 hours. Returns: Formatted string with trending coins

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that fetches trending cryptocurrencies from CoinGecko API, formats the top 10 into a ranked list, and returns as a formatted string. No input parameters required.
    def get_trending_crypto() -> str: """ Gets the top trending cryptocurrencies in the last 24 hours. Returns: Formatted string with trending coins """ try: data = cg.get_search_trending() coins = data.get('coins', []) if not coins: return "No trending coins data available" summary = ["=== TRENDING CRYPTOCURRENCIES (24h) ===\n"] for i, item in enumerate(coins[:10], 1): coin = item.get('item', {}) summary.append( f"{i}. {coin.get('name')} ({coin.get('symbol', 'N/A').upper()})" f" - Rank #{coin.get('market_cap_rank', 'N/A')}" ) return "\n".join(summary) except Exception as e: logger.error(f"CoinGecko error: {e}") return f"Error fetching trending coins: {str(e)}"
  • server.py:415-418 (registration)
    Registers get_trending_crypto as an MCP tool using the register_tools helper, which applies @mcp.tool() decorator to it along with other crypto tools.
    register_tools( [get_crypto_price, get_crypto_market_data, get_trending_crypto, search_crypto], "Cryptocurrency" )
  • server.py:21-21 (registration)
    Import statement that brings the get_trending_crypto function into the server module for registration.
    from tools.crypto_data import get_crypto_price, get_crypto_market_data, get_trending_crypto, search_crypto
  • MCP resource that proxies calls to get_trending_crypto, providing trending crypto data via the 'crypto://trending' URI.
    @mcp.resource("crypto://trending") def get_crypto_resource() -> str: """ Returns the top trending cryptocurrencies. """ return get_trending_crypto()

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/N-lia/MonteWalk'

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