get_trending
Identify trending coins, NFTs, and categories on CoinGecko based on search volume from the last 24 hours. Use this tool to surface narratives and emergent market interest before price movements.
Instructions
Get currently trending coins, NFT collections and categories on CoinGecko (last 24h searches).
Use to answer "what is the market paying attention to right now?" or to surface narratives. This is search-driven, not volume-driven, so it captures emergent interest before price moves.
Returns:
Object with arrays coins, nfts, and categories. Each coin item
includes item.id, item.name, item.symbol, item.market_cap_rank,
and item.data with price/24h-change snapshot.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- coin_mcp/coingecko.py:310-323 (handler)The actual tool handler: decorated with @mcp.tool(), fetches trending coins/NFTs/categories from CoinGecko's /search/trending endpoint.
@mcp.tool() async def get_trending() -> Any: """Get currently trending coins, NFT collections and categories on CoinGecko (last 24h searches). Use to answer "what is the market paying attention to right now?" or to surface narratives. This is search-driven, not volume-driven, so it captures emergent interest before price moves. Returns: Object with arrays `coins`, `nfts`, and `categories`. Each coin item includes `item.id`, `item.name`, `item.symbol`, `item.market_cap_rank`, and `item.data` with price/24h-change snapshot. """ return await _cg_get("/search/trending") - coin_mcp/coingecko.py:1-7 (schema)Imports for the handler: _cg_get (HTTP helper) and mcp (FastMCP instance) from core.
"""CoinGecko tools — aggregated market data, exchanges directory, NFTs, categories, treasuries.""" from __future__ import annotations import re from typing import Any, Literal from .core import _bool_str, _cg_get, mcp - coin_mcp/coingecko.py:310-311 (registration)Registration via @mcp.tool() decorator on the get_trending function.
@mcp.tool() async def get_trending() -> Any: - coin_mcp/core.py:220-225 (helper)The _cg_get helper constructs the CoinGecko base URL + path and delegates to _http_get.
async def _cg_get(path: str, params: dict[str, Any] | None = None) -> Any: return await _http_get( f"{_coingecko_base()}{path}", params=params, headers=_coingecko_headers(), ) - coin_mcp/core.py:206-217 (helper)The _http_get helper that performs the actual HTTP GET via TTL cache.
async def _http_get( url: str, params: dict[str, Any] | None = None, headers: dict[str, str] | None = None, ) -> Any: """GET a URL and return JSON, or a structured error dict on failure. Delegates to the in-process TTL cache so repeated identical requests don't re-hit the network. See `coin_mcp.cache` for routing rules. """ from . import cache # local import to avoid circular dependency at module load return await cache.cached_http_get(url, params=params, headers=headers)