Skip to main content
Glama
manimohans

The Verge News MCP Server

by manimohans

get-daily-news

Fetch today's news articles from The Verge to stay informed about current technology, science, and culture developments.

Instructions

Get the latest news from The Verge for today

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Handler function that fetches The Verge RSS feed, filters news from the last 24 hours, formats top 10 as brief summaries, and returns structured text content or error.
    async () => { try { const allNews = await fetchVergeNews(); const todayNews = filterNewsByDate(allNews, 1); // Last 24 hours const formattedNews = formatNewsItems(todayNews); const newsText = formatNewsAsBriefSummary(formattedNews, 10); // Limit to 10 items with brief summaries return { content: [ { type: "text", text: `# The Verge - Today's News\n\n${newsText}` } ] }; } catch (error) { console.error("Error in get-daily-news:", error); return { content: [ { type: "text", text: `Error fetching daily news: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } }
  • src/index.ts:145-177 (registration)
    Registers the 'get-daily-news' tool on the MCP server with name, description, empty input schema, and the handler function.
    server.tool( "get-daily-news", "Get the latest news from The Verge for today", {}, async () => { try { const allNews = await fetchVergeNews(); const todayNews = filterNewsByDate(allNews, 1); // Last 24 hours const formattedNews = formatNewsItems(todayNews); const newsText = formatNewsAsBriefSummary(formattedNews, 10); // Limit to 10 items with brief summaries return { content: [ { type: "text", text: `# The Verge - Today's News\n\n${newsText}` } ] }; } catch (error) { console.error("Error in get-daily-news:", error); return { content: [ { type: "text", text: `Error fetching daily news: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } } );
  • Fetches and parses the RSS feed from The Verge, returns the items array. Used by the handler to get all news.
    async function fetchVergeNews() { try { const feed = await parser.parseURL(VERGE_RSS_URL); return feed.items; } catch (error) { console.error("Error fetching RSS feed:", error); throw new Error("Failed to fetch news from The Verge"); } }
  • Filters RSS items to those published within the last 'daysBack' days. Called with 1 for daily news.
    function filterNewsByDate(items: Parser.Item[], daysBack: number) { const now = new Date(); const cutoffDate = new Date(now.setDate(now.getDate() - daysBack)); return items.filter((item) => { if (!item.pubDate) return false; const pubDate = new Date(item.pubDate); return pubDate >= cutoffDate; }); }
  • Formats formatted news items into brief text summaries with title, link, and truncated content (limit 150 chars), up to 'limit' items. Used with 10.
    function formatNewsAsBriefSummary(items: ReturnType<typeof formatNewsItems>, limit: number = 10) { if (items.length === 0) { return "No news articles found for the specified time period."; } // Limit the number of items const limitedItems = items.slice(0, limit); return limitedItems.map((item, index) => { // Extract a brief summary (first 150 characters) const summary = item.content.substring(0, 150).trim() + (item.content.length > 150 ? "..." : ""); return ` ${index + 1}. ${item.title} Link: ${item.link} Summary: ${summary} `; }).join("\n---\n"); }

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/manimohans/verge-news-mcp'

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