Skip to main content
Glama

get_rss_feed

Extract and format RSS feed content into Markdown, displaying the title and up to 10 entries with links, dates, and plain text summaries. Use to monitor crypto updates efficiently.

Instructions

Retrieve the content of the specified RSS feed. Parameters: feed_url (str): The URL of the RSS feed to fetch (e.g., 'https://cointelegraph.com/rss'). ctx (Context, optional): MCP context for logging or progress reporting. Returns: str: A formatted Markdown string containing the feed title and up to 10 latest entries with titles, links, publication dates, and summaries converted from HTML to plain text.

Input Schema

NameRequiredDescriptionDefault
feed_urlYes

Input Schema (JSON Schema)

{ "properties": { "feed_url": { "title": "Feed Url", "type": "string" } }, "required": [ "feed_url" ], "title": "get_rss_feedArguments", "type": "object" }

Implementation Reference

  • The primary handler for the 'get_rss_feed' tool. Decorated with @mcp.tool() for registration in FastMCP. Fetches RSS feed via helper, processes up to 10 entries, converts HTML to Markdown-friendly text, and returns formatted output.
    @mcp.tool() async def get_rss_feed(feed_url: str, ctx: Context = None) -> str: """ Retrieve the content of the specified RSS feed. Parameters: feed_url (str): The URL of the RSS feed to fetch (e.g., 'https://cointelegraph.com/rss'). ctx (Context, optional): MCP context for logging or progress reporting. Returns: str: A formatted Markdown string containing the feed title and up to 10 latest entries with titles, links, publication dates, and summaries converted from HTML to plain text. """ ctx.info(f"Fetching RSS feed from {feed_url}") feed = await fetch_rss_feed(feed_url) entries = feed.entries[:10] # Limit to the latest 10 entries # Initialize html2text converter h = html2text.HTML2Text() h.body_width = 0 # Disable line wrapping h.ignore_links = True # Ignore links in summary h.ignore_images = True # Ignore images in summary h.inline_links = False # Ensure links are not embedded in text h.mark_code = False # Disable code block markers h.use_automatic_links = False # Disable automatic link references h.skip_internal_headers = True # Ignores <h1>-<h6> tags result = f"# Feed: {feed.feed.title}\n\n" for i, entry in enumerate(entries): # Convert HTML summary to plain text summary_text = h.handle(entry.summary).strip() # Post-process to demote ## headers to ### in summary summary_text = re.sub(r'^\s*##\s+(.+)$', r'### \1', summary_text, flags=re.MULTILINE) result += f"## Entry {i + 1}\n" result += f"- **Title**: {entry.title}\n" result += f"- **Link**: [{entry.link}]({entry.link})\n" result += f"- **Published**: {entry.published}\n" result += f"- **Summary**: {summary_text}\n\n" return result
  • Helper utility function used by get_rss_feed to asynchronously fetch and parse the RSS feed using httpx and feedparser.
    async def fetch_rss_feed(url: str) -> feedparser.FeedParserDict: """Fetch and parse an RSS feed from the specified URL.""" async with httpx.AsyncClient() as client: response = await client.get(url) response.raise_for_status() return feedparser.parse(response.text)
  • The @mcp.tool() decorator registers the get_rss_feed function as an MCP tool in the FastMCP server.
    @mcp.tool()

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/kukapay/crypto-rss-mcp'

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