Skip to main content
Glama
DumplingAI

Dumpling AI MCP Server

Official
by DumplingAI

search-news

Find news articles from multiple sources by specifying queries, country, language, location, and date range for targeted and relevant results.

Instructions

Search for news articles across multiple sources.

Input Schema

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

Implementation Reference

  • The handler function that executes the 'search-news' tool logic, proxying the request to the Dumpling AI news search API and returning the results.
    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 input schema defining parameters for the 'search-news' tool including query, filters, and pagination.
    { 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"), },
  • src/index.ts:236-280 (registration)
    Registration of the 'search-news' tool on the MCP server using server.tool(), including name, description, schema, and handler function.
    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) }] }; } );

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