Skip to main content
Glama

get_latest_news

Fetch recent Arch Linux news from RSS feed to stay informed about updates, security advisories, and community announcements.

Instructions

[DISCOVERY] Fetch recent Arch Linux news from RSS feed. Returns title, date, summary, and link for each news item.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of news items to return (default 10)
since_dateNoOptional date in ISO format (YYYY-MM-DD) to filter news

Implementation Reference

  • Core handler function that fetches Arch Linux news RSS feed using httpx, parses XML with ElementTree, extracts title/link/date/summary, strips HTML, parses dates, optionally filters by since_date, truncates summaries, and returns structured list or error response.
    async def get_latest_news( limit: int = 10, since_date: Optional[str] = None ) -> Dict[str, Any]: """ Fetch recent Arch Linux news from RSS feed. Args: limit: Maximum number of news items to return (default 10) since_date: Optional date in ISO format (YYYY-MM-DD) to filter news Returns: Dict with news items (title, date, summary, link) """ logger.info(f"Fetching latest Arch Linux news (limit={limit})") try: async with httpx.AsyncClient(timeout=10.0) as client: response = await client.get(ARCH_NEWS_URL) response.raise_for_status() # Parse RSS feed root = ET.fromstring(response.content) # Find all items (RSS 2.0 format) news_items = [] for item in root.findall('.//item')[:limit]: title_elem = item.find('title') link_elem = item.find('link') pub_date_elem = item.find('pubDate') description_elem = item.find('description') if title_elem is None or link_elem is None: continue title = title_elem.text link = link_elem.text pub_date = pub_date_elem.text if pub_date_elem is not None else "" # Parse description and strip HTML tags description = "" if description_elem is not None and description_elem.text: description = re.sub(r'<[^>]+>', '', description_elem.text) # Truncate to first 300 chars for summary description = description[:300] + "..." if len(description) > 300 else description # Parse date published_date = "" if pub_date: try: # Parse RFC 822 date format dt = datetime.strptime(pub_date, "%a, %d %b %Y %H:%M:%S %z") published_date = dt.isoformat() except ValueError: published_date = pub_date # Filter by date if requested if since_date and published_date: try: item_date = datetime.fromisoformat(published_date.replace('Z', '+00:00')) filter_date = datetime.fromisoformat(since_date + "T00:00:00+00:00") if item_date < filter_date: continue except ValueError as e: logger.warning(f"Failed to parse date for filtering: {e}") news_items.append({ "title": title, "link": link, "published": published_date, "summary": description.strip() }) logger.info(f"Successfully fetched {len(news_items)} news items") return { "count": len(news_items), "news": news_items } except httpx.HTTPStatusError as e: logger.error(f"HTTP error fetching news: {e}") return create_error_response( "HTTPError", f"Failed to fetch Arch news: HTTP {e.response.status_code}" ) except httpx.TimeoutException: logger.error("Timeout fetching Arch news") return create_error_response( "Timeout", "Request to Arch news feed timed out" ) except ET.ParseError as e: logger.error(f"Failed to parse RSS feed: {e}") return create_error_response( "ParseError", f"Failed to parse Arch news RSS feed: {str(e)}" ) except Exception as e: logger.error(f"Unexpected error fetching news: {e}") return create_error_response( "NewsError", f"Failed to fetch Arch news: {str(e)}" )
  • MCP tool registration in list_tools(): defines tool name, description, and input JSON schema for 'limit' (int, default 10) and 'since_date' (str, optional).
    Tool( name="get_latest_news", description="[DISCOVERY] Fetch recent Arch Linux news from RSS feed. Returns title, date, summary, and link for each news item.", inputSchema={ "type": "object", "properties": { "limit": { "type": "integer", "description": "Maximum number of news items to return (default 10)", "default": 10 }, "since_date": { "type": "string", "description": "Optional date in ISO format (YYYY-MM-DD) to filter news" } }, "required": [] } ),
  • MCP server call_tool handler for get_latest_news: extracts 'limit' and 'since_date' from arguments, calls the core get_latest_news function, serializes result to JSON, and returns as TextContent.
    limit = arguments.get("limit", 10) since_date = arguments.get("since_date") result = await get_latest_news(limit=limit, since_date=since_date) return [TextContent(type="text", text=json.dumps(result, indent=2))]
  • Tool metadata schema defining category ('discovery'), platform ('any'), permission ('read'), workflow ('safety'), and related tools.
    "get_latest_news": ToolMetadata( name="get_latest_news", category="discovery", platform="any", permission="read", workflow="safety", related_tools=["check_critical_news", "get_news_since_last_update"], prerequisite_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/nihalxkumar/arch-mcp'

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