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"),
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'search' but doesn't describe what the search returns (e.g., article list, summaries), pagination behavior, rate limits, authentication needs, or error handling. For a search tool with 6 parameters and no annotations, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose without any wasted words. It's appropriately sized for a search tool, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (6 parameters, no annotations, no output schema), the description is incomplete. It doesn't explain the return values, result format, or behavioral aspects like pagination or source limitations. For a search tool with multiple filtering options, more context is needed to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, meaning all parameters are documented in the schema itself. The description adds no additional meaning beyond what's in the schema (e.g., it doesn't explain how 'country' and 'location' interact or provide examples beyond the schema's 'e.g.' notes). Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('search') and resource ('news articles across multiple sources'), making it immediately understandable. However, it doesn't distinguish this tool from the sibling 'search' tool, which appears to be a more general search function, so it misses full differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With a sibling tool named 'search' that likely serves a broader purpose, there's no indication of when to prefer news-specific searching over general searching or other search-related tools like 'search-knowledge-base' or 'search-maps'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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