Skip to main content
Glama
DumplingAI

Dumpling AI MCP Server

Official
by DumplingAI

search-news

Search for news articles across multiple sources using customizable filters like location, language, and time range to find relevant information.

Instructions

Search for news articles across multiple sources.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query
countryNoCountry code (e.g., 'us')
locationNoLocation name
languageNoLanguage code (e.g., 'en')
dateRangeNoTime range filter
pageNoPage number

Implementation Reference

  • src/index.ts:236-280 (registration)
    Complete registration of the 'search-news' MCP tool, including name, description, input schema, and execution handler.
    server.tool( "search-news", "Search for news articles across multiple sources.", { query: z.string().describe("Search query"), country: z.string().optional().describe("Country code (e.g., 'us')"), location: z.string().optional().describe("Location name"), language: z.string().optional().describe("Language code (e.g., 'en')"), dateRange: z .enum([ "anyTime", "pastHour", "pastDay", "pastWeek", "pastMonth", "pastYear", ]) .optional() .describe("Time range filter"), page: z.number().optional().describe("Page number"), }, async ({ query, country, location, language, dateRange, page }) => { const apiKey = process.env.DUMPLING_API_KEY; if (!apiKey) throw new Error("DUMPLING_API_KEY not set"); const response = await fetch(`${NWS_API_BASE}/api/v1/search-news`, { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${apiKey}`, }, body: JSON.stringify({ query, country, location, language, dateRange, page, }), }); if (!response.ok) throw new Error(`Failed: ${response.status} ${await response.text()}`); const data = await response.json(); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; } );
  • The handler function for 'search-news' tool that makes a POST request to the Dumpling AI API endpoint /api/v1/search-news with the provided parameters and returns the JSON response as text content.
    async ({ query, country, location, language, dateRange, page }) => { const apiKey = process.env.DUMPLING_API_KEY; if (!apiKey) throw new Error("DUMPLING_API_KEY not set"); const response = await fetch(`${NWS_API_BASE}/api/v1/search-news`, { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${apiKey}`, }, body: JSON.stringify({ query, country, location, language, dateRange, page, }), }); if (!response.ok) throw new Error(`Failed: ${response.status} ${await response.text()}`); const data = await response.json(); return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] }; }
  • Zod schema defining the input parameters for the 'search-news' tool: query (required string), optional country, location, language, dateRange (enum), and page (number).
    { query: z.string().describe("Search query"), country: z.string().optional().describe("Country code (e.g., 'us')"), location: z.string().optional().describe("Location name"), language: z.string().optional().describe("Language code (e.g., 'en')"), dateRange: z .enum([ "anyTime", "pastHour", "pastDay", "pastWeek", "pastMonth", "pastYear", ]) .optional() .describe("Time range filter"), page: z.number().optional().describe("Page number"), },

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/DumplingAI/mcp-server-dumplingai'

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