Skip to main content
Glama

get-theverge-news

Fetch insights on tech innovation, digital product reviews, internet trends, and tech company updates from The Verge to stay informed on emerging developments.

Instructions

获取 The Verge 新闻,包含科技创新、数码产品评测、互联网趋势及科技公司动态的英文科技资讯

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that fetches the RSS feed from The Verge, validates the entries, processes links to canonical form, and maps to output format with title, description, publish_time, and link.
    func: async () => { const rss = await getRss('https://www.theverge.com/rss/index.xml'); if (!Array.isArray(rss.feed.entry)) { throw new Error('获取 The Verge 新闻失败'); } return (rss.feed.entry as any[]).map((item) => { let link = item.link; if (!link && item.id) { link = item.id; } const url = new URL(link); if (url.searchParams.has('p')) { url.pathname = url.searchParams.get('p') as string; url.search = ''; link = url.toString(); } return { title: item.title, description: item.summary, publish_time: item.published, link, }; }); },
  • The tool registration using defineToolConfig, exporting the configuration with name, description, and reference to the handler function. Loaded dynamically by the MCP server.
    export default defineToolConfig({ name: 'get-theverge-news', description: '获取 The Verge 新闻,包含科技创新、数码产品评测、互联网趋势及科技公司动态的英文科技资讯', func: async () => { const rss = await getRss('https://www.theverge.com/rss/index.xml'); if (!Array.isArray(rss.feed.entry)) { throw new Error('获取 The Verge 新闻失败'); } return (rss.feed.entry as any[]).map((item) => { let link = item.link; if (!link && item.id) { link = item.id; } const url = new URL(link); if (url.searchParams.has('p')) { url.pathname = url.searchParams.get('p') as string; url.search = ''; link = url.toString(); } return { title: item.title, description: item.summary, publish_time: item.published, link, }; }); }, });
  • Shared helper function to fetch RSS feed via HTTP and parse it using fast-xml-parser.
    export const getRss = async (url: string) => { const resp = await http.get(url); const parser = new XMLParser(); return parser.parse(resp.data); };

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/baranwang/mcp-trends-hub'

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