# CoinMarketCap Crypto News

#### CMC Crypto News Tool (`cmc_crypto_news_tool`)

Fetches the latest general cryptocurrency news articles by scraping CoinMarketCap's news headlines. Keeps you updated with recent happenings in the crypto space.

***

```python
class CMCCryptoNewsInput(BaseModel):
    limit: int = 8 # Number of articles (default 8, max 8)
```

***

**Key Functionality:**

* Scrapes the latest crypto news headlines and summaries from `coinmarketcap.com/headlines/news/`.
* For each article, it attempts to extract the heading, a brief body/summary, associated crypto tickers, and how long ago it was posted.
* The number of articles returned is controlled by `limit`, effectively capped at 8.

***

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

* "What's the latest crypto news from CoinMarketCap?"
* "Fetch the top 5 recent crypto news articles."
* "Get today's crypto headlines via CMC."
* "Show me the newest updates in the cryptocurrency world."
* "Can you retrieve some crypto news for me?"
* "What are the current news stories on CoinMarketCap?"
* "Give me a summary of recent crypto events."
* "Fetch 3 crypto news items."

***

**Quick Code Glance:**

```python
class CMCCryptoNewsTool(BaseTool):
    name: ClassVar[str] = "cmc_crypto_news_tool"
    description: ClassVar[str] = "Get the latest crypto news from CoinMarketCap."
    args_schema: ClassVar[Type[BaseModel]] = CMCCryptoNewsInput
```

***

**Important:**

* This tool operates **asynchronously** (`_arun`) only.
* Relies on **web scraping** CoinMarketCap, which means its functionality can be affected by changes to the website's structure.
* The `limit` for news articles defaults to 8 and is also capped at a maximum of 8.


---

# 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-crypto-news.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.
