Skip to main content
Glama
manimohans

The Verge News MCP Server

by manimohans

search-news

Search for The Verge news articles by keyword to find relevant content from the past 30 days.

Instructions

Search for news articles from The Verge by keyword

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keywordYesKeyword to search for in news articles
daysNoNumber of days to look back (default: 30)

Implementation Reference

  • The main handler function for the 'search-news' tool. It fetches the latest news from The Verge RSS feed, filters articles by the specified number of days and keyword (in title or content), formats them into brief summaries (limited to 10 items), and returns the result as structured text content or an error response.
    async ({ keyword, days = 30 }) => { try { const allNews = await fetchVergeNews(); const filteredByDate = filterNewsByDate(allNews, days); const filteredByKeyword = filterNewsByKeyword(filteredByDate, keyword); const formattedNews = formatNewsItems(filteredByKeyword); const newsText = formatNewsAsBriefSummary(formattedNews, 10); // Use brief summary format with limit of 10 return { content: [ { type: "text", text: `# The Verge - Search Results for "${keyword}"\n\n${newsText}` } ] }; } catch (error) { console.error("Error in search-news:", error); return { content: [ { type: "text", text: `Error searching news: ${error instanceof Error ? error.message : String(error)}` } ], isError: true }; } }
  • Zod input schema defining the parameters for the 'search-news' tool: required 'keyword' string and optional 'days' number.
    { keyword: z.string().describe("Keyword to search for in news articles"), days: z.number().optional().describe("Number of days to look back (default: 30)") },
  • src/index.ts:219-225 (registration)
    MCP server tool registration call for 'search-news', specifying the tool name, description, and input schema. The handler function follows immediately after.
    server.tool( "search-news", "Search for news articles from The Verge by keyword", { keyword: z.string().describe("Keyword to search for in news articles"), days: z.number().optional().describe("Number of days to look back (default: 30)") },
  • Helper function used by the search-news handler to filter news items containing the keyword in title or content (case-insensitive).
    function filterNewsByKeyword(items: Parser.Item[], keyword: string) { const lowerKeyword = keyword.toLowerCase(); return items.filter((item) => { const title = (item.title || "").toLowerCase(); const content = (item.contentSnippet || item.content || "").toLowerCase(); return title.includes(lowerKeyword) || content.includes(lowerKeyword); }); }
  • Core helper function that fetches and parses the RSS feed from The Verge, returning the list of news items. Used by the search-news handler.
    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"); } }

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