Skip to main content
Glama
DumplingAI

Dumpling AI MCP Server

Official
by DumplingAI

get-autocomplete

Generate Google autocomplete suggestions for a search query, refining results based on location, country, and language parameters to enhance search accuracy and relevance.

Instructions

Retrieve Google autocomplete suggestions for a query.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
countryNoCountry code (e.g., 'us')
languageNoLanguage code (e.g., 'en')
locationNoLocation name
queryYesSearch query

Implementation Reference

  • The handler function that executes the tool logic: authenticates with DUMPLING_API_KEY, POSTs parameters to external API at NWS_API_BASE/api/v1/get-autocomplete, parses response, and formats as MCP content block.
    async ({ query, location, country, language }) => { 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/get-autocomplete`, { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${apiKey}`, }, body: JSON.stringify({ query, location, country, language }), }); 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) }] };
  • Input schema using Zod: query (string), optional location, country, language with descriptions.
    { query: z.string().describe("Search query"), location: z.string().optional().describe("Location name"), country: z.string().optional().describe("Country code (e.g., 'us')"), language: z.string().optional().describe("Language code (e.g., 'en')"), },
  • src/index.ts:139-164 (registration)
    server.tool() registration call defining the tool name 'get-autocomplete', description, input schema, and handler function.
    server.tool( "get-autocomplete", "Retrieve Google autocomplete suggestions for a query.", { query: z.string().describe("Search query"), location: z.string().optional().describe("Location name"), country: z.string().optional().describe("Country code (e.g., 'us')"), language: z.string().optional().describe("Language code (e.g., 'en')"), }, async ({ query, location, country, language }) => { 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/get-autocomplete`, { method: "POST", headers: { "Content-Type": "application/json", Authorization: `Bearer ${apiKey}`, }, body: JSON.stringify({ query, location, country, language }), }); 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