Skip to main content
Glama

recent_news

Stay updated on cryptocurrency and blockchain news by retrieving the latest articles from CoinDesk's RSS feed. Returns formatted entries with titles, links, timestamps, and summaries.

Instructions

Retrieves the latest cryptocurrency and blockchain news articles from CoinDesk's RSS feed. Fetches the current RSS feed from CoinDesk, parses it to extract information about recent articles, and returns a formatted list of news items including titles, links, publication timestamps, and summary content. Returns: str: A formatted string containing multiple news entries separated by '---', with each entry showing title, URL, publication time, and summary Raises: HTTPStatusError: If the RSS feed request fails Exception: If RSS parsing encounters errors

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'recent_news' tool. It fetches the RSS feed for the specified site (coindesk or decrypt), parses it using feedparser, and returns a formatted string of recent news entries separated by ---.
    @mcp.tool() async def recent_news(site: Literal["coindesk", "decrypt"]) -> str: """ Gets latest crypto news from specified site. Args: site: Site to fetch news from ("coindesk" or "decrypt") Returns: Formatted list of news entries with titles, links, dates and summaries """ url = RSS_URLS.get(site) if url is None: raise ValueError(f"Unsupported site: {site}") text = await fetch_text_from_url(url) feed = feedparser.parse(text) return "\n---\n".join( f"{entry['title']}\n{entry['link']}\n{entry['updated']}\n{entry['summary']}" for entry in feed["entries"] )
  • The @mcp.tool() decorator registers the recent_news function as an MCP tool.
    @mcp.tool()
  • Constant dictionary mapping site names to their RSS feed URLs, used by the recent_news handler.
    RSS_URLS = { "coindesk": "https://www.coindesk.com/arc/outboundfeeds/rss", "decrypt": "https://decrypt.co/feed", }
  • Async utility function to fetch text content from a URL using httpx. Called by recent_news to retrieve the RSS feed data.
    async def fetch_text_from_url(url: str) -> str: """ Asynchronously retrieves text content from a specified URL. Makes an HTTP GET request to the provided URL and returns the response content as text. Handles connection setup and cleanup automatically. Args: url (str): The URL to fetch content from Returns: str: The text content received from the URL Raises: HTTPStatusError: If the HTTP request returns a non-2xx status code RequestError: If a network-related error occurs during the request """ async with httpx.AsyncClient() as client: response = await client.get(url) response.raise_for_status() return response.text

Other Tools

Related 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/narumiruna/coindesk-mcp'

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