# CoinMarketCap Trending Coins Tool

**CMC Trending Coins Tool (`cmc_trending_coins_tool`)**

Fetches a list of the top active cryptocurrencies ranked by market capitalization from the CoinMarketCap (CMC) Pro API, providing key market data for each.

{% hint style="info" %}
**Input:** Accepts an optional `limit` for the number of coins to retrieve.
{% endhint %}

```python
class CMCTrendingCoinsInput(BaseModel):
    limit: int = 20 # Number of coins (default 20, max 100)
```

***

**Key Functionality:**

* Retrieves a list of top cryptocurrencies (e.g., Bitcoin, Ethereum) sorted by market cap from the `pro-api.coinmarketcap.com`.
* For each coin, it provides its CMC rank, name, symbol, current price in USD, market capitalization, and 24-hour price change percentage.
* The number of results can be specified using `limit`, up to a maximum of 100.

***

**Sample Usage Queries (How an AI might use it):**

* "What are the top 10 cryptocurrencies by market cap from CoinMarketCap?"
* "Show me the leading 25 coins according to CMC."
* "Get CoinMarketCap's list of top cryptocurrencies."
* "List the top coins with a limit of 50 from CMC."
* "Which coins are currently at the top of CoinMarketCap rankings?"
* "Fetch the top 100 crypto listings from CMC."
* "Can you show me CoinMarketCap's main cryptocurrency list?"
* "What are the leading cryptocurrencies today via CMC?"

***

```python
class CMCTrendingCoinsTool(BaseTool):
    name: ClassVar[str] = "cmc_trending_coins_tool"
    description: ClassVar[str] = "Get a list of all active cryptocurrencies with latest market data from CoinMarketCap."
    args_schema: ClassVar[Type[BaseModel]] = CMCTrendingCoinsInput
```

***

**Important:**

* This tool operates **asynchronously** (`_arun`) only.
* Requires a valid CoinMarketCap Pro API Key (`CONFIG.CMC_API_KEY`) to be configured in the backend.
* The `limit` parameter defaults to 20 and is capped at a maximum of 100 coins.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.lumolabs.ai/tools/coinmarketcap-trending-coins-tool.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
