Skip to main content
Glama
DumplingAI

Dumpling AI MCP Server

Official
by DumplingAI

search

Perform Google web searches with customizable parameters like location, language, date range, and result scraping options to find specific information.

Instructions

Perform Google web searches with customizable parameters.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query
countryNoCountry code (e.g., 'us')
locationNoLocation name
languageNoLanguage code (e.g., 'en')
dateRangeNoTime range filter
pageNoPage number
scrapeResultsNoWhether to scrape results
numResultsToScrapeNoNumber of results to scrape
scrapeOptionsNoScraping options

Implementation Reference

  • The handler function that executes the 'search' tool logic by making a POST request to the DumplingAI API's /api/v1/search endpoint with the provided parameters and returning the JSON response.
    async ({ query, country, location, language, dateRange, page, scrapeResults, numResultsToScrape, scrapeOptions, }) => { 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`, { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${apiKey}`, }, body: JSON.stringify({ query, country, location, language, dateRange, page, scrapeResults, numResultsToScrape, scrapeOptions, }), }); 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' tool, including query, optional filters like country, location, dateRange, and scraping options.
    { 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"), scrapeResults: z.boolean().optional().describe("Whether to scrape results"), numResultsToScrape: z .number() .optional() .describe("Number of results to scrape"), scrapeOptions: z .object({ format: z.enum(["markdown", "html", "screenshot"]).optional(), cleaned: z.boolean().optional(), }) .optional() .describe("Scraping options"), },
  • src/index.ts:67-136 (registration)
    The server.tool call that registers the 'search' tool with the MCP server, specifying its name, description, input schema, and handler function.
    server.tool( "search", "Perform Google web searches with customizable parameters.", { 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"), scrapeResults: z.boolean().optional().describe("Whether to scrape results"), numResultsToScrape: z .number() .optional() .describe("Number of results to scrape"), scrapeOptions: z .object({ format: z.enum(["markdown", "html", "screenshot"]).optional(), cleaned: z.boolean().optional(), }) .optional() .describe("Scraping options"), }, async ({ query, country, location, language, dateRange, page, scrapeResults, numResultsToScrape, scrapeOptions, }) => { 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`, { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${apiKey}`, }, body: JSON.stringify({ query, country, location, language, dateRange, page, scrapeResults, numResultsToScrape, scrapeOptions, }), }); 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