Skip to main content
Glama
ymylive
by ymylive

list_top_coins

List top cryptocurrencies with market data including price, market cap, volume, and price change percentages. Sort by market cap or volume, filter by category (e.g., DeFi, layer-1), and paginate results.

Instructions

List top coins with market data (price, market cap, volume, change %) — sortable and paginated.

The workhorse for "show me the top N coins" / "top by volume" / "top in DeFi" style questions. Each call returns up to 250 coins; paginate for more.

Args: vs_currency: Quote currency (e.g. "usd"). order: Sort order. Default is descending market cap. per_page: 1..250 coins per page. page: Page number, 1-indexed. category: Optional category ID to filter by (see list_categories), e.g. "decentralized-finance-defi", "layer-1", "meme-token". price_change_percentages: Comma list of windows to include — any of "1h,24h,7d,14d,30d,200d,1y".

Returns: Array of coin objects with id, symbol, name, image, current_price, market_cap, market_cap_rank, total_volume, high_24h, low_24h, price_change_*_in_currency, ath, atl, circulating_supply, etc.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
vs_currencyNousd
orderNomarket_cap_desc
per_pageNo
pageNo
categoryNo
price_change_percentagesNo24h

Implementation Reference

  • The main handler for the list_top_coins tool. Decorated with @mcp.tool(), it builds query parameters and calls CoinGecko's /coins/markets endpoint via the cached HTTP helper _cg_get.
    @mcp.tool()
    async def list_top_coins(
        vs_currency: str = "usd",
        order: Literal[
            "market_cap_desc", "market_cap_asc",
            "volume_desc", "volume_asc",
            "id_asc", "id_desc",
        ] = "market_cap_desc",
        per_page: int = 100,
        page: int = 1,
        category: str = "",
        price_change_percentages: str = "24h",
    ) -> Any:
        """List top coins with market data (price, market cap, volume, change %) — sortable and paginated.
    
        The workhorse for "show me the top N coins" / "top by volume" / "top in
        DeFi" style questions. Each call returns up to 250 coins; paginate for more.
    
        Args:
            vs_currency: Quote currency (e.g. "usd").
            order: Sort order. Default is descending market cap.
            per_page: 1..250 coins per page.
            page: Page number, 1-indexed.
            category: Optional category ID to filter by (see `list_categories`),
                e.g. "decentralized-finance-defi", "layer-1", "meme-token".
            price_change_percentages: Comma list of windows to include —
                any of "1h,24h,7d,14d,30d,200d,1y".
    
        Returns:
            Array of coin objects with id, symbol, name, image, current_price,
            market_cap, market_cap_rank, total_volume, high_24h, low_24h,
            price_change_*_in_currency, ath, atl, circulating_supply, etc.
        """
        params: dict[str, Any] = {
            "vs_currency": vs_currency,
            "order": order,
            "per_page": max(1, min(per_page, 250)),
            "page": max(1, page),
            "sparkline": "false",
            "price_change_percentage": price_change_percentages,
        }
        if category:
            params["category"] = category
        return await _cg_get("/coins/markets", params)
  • Input type schema and parameter defaults for list_top_coins. Parameters include vs_currency, order (Literal of sort options), per_page (1-250), page, category filter, and price_change_percentages.
    async def list_top_coins(
        vs_currency: str = "usd",
        order: Literal[
            "market_cap_desc", "market_cap_asc",
            "volume_desc", "volume_asc",
            "id_asc", "id_desc",
        ] = "market_cap_desc",
        per_page: int = 100,
        page: int = 1,
        category: str = "",
        price_change_percentages: str = "24h",
    ) -> Any:
  • Tool registration via the @mcp.tool() decorator on the FastMCP instance from coin_mcp.core. The registration occurs at module import time (triggered by server.py importing coin_mcp.coingecko).
    @mcp.tool()
  • The _cg_get helper constructs the full CoinGecko URL (choosing Pro or Public base) and delegates to the cached _http_get with auth headers.
    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(),
        )
  • Cache TTL rule for the /coins/markets endpoint (used by list_top_coins): 60-second TTL, labeled 'coins/markets'.
    ("/api/v3/coins/markets", 60.0, "coins/markets"),
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full responsibility. It explains the tool's behavior (list, sort, paginate) but omits details like rate limits, authentication needs, data freshness, or any side effects, which is a moderate gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a concise summary, a helpful one-sentence context, a bulleted Args list, and a Returns list. Every sentence adds value without redundancy, making it efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 6 parameters, all optional, no output schema, and many sibling tools, the description provides sufficient context: usage patterns, parameter details, and return fields. Minor omissions like error handling or limits beyond pagination prevent a perfect score.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description thoroughly explains all 6 parameters in the Args block, including defaults, possible values for order, category reference to list_categories, and format for price_change_percentages, adding significant meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'List top coins with market data (price, market cap, volume, change %)' and identifies specific use cases like 'show me the top N coins' and 'top by volume', distinguishing it from sibling tools such as get_price or get_top_gainers_losers.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly explains when to use the tool ('workhorse for show me the top N coins style questions') and mentions pagination for more results, but does not explicitly state when not to use it or provide alternatives beyond the implicit context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/ymylive/coin-mcp'

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