Skip to main content
Glama

google-search

Retrieve Google search results programmatically using specified queries, language, and country parameters. Ideal for integrating web data into applications via the Scrapeless MCP Server.

Instructions

Fetch Google Search Results

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
glNoParameter defines the country to use for the Google search. It's a two-letter country code. (e.g., us for the United States, uk for United Kingdom, or fr for France).
hlNoParameter defines the language to use for the Google search. It's a two-letter language code. (e.g., en for English, es for Spanish, or fr for French).
queryYesParameter defines the query you want to search. You can use anything that you would use in a regular Google search. e.g. inurl:, site:, intitle:. We also support advanced search query parameters such as as_dt and as_eq.

Implementation Reference

  • The asynchronous handle function that executes the Google search by calling client.deepserp.scrape with actor 'scraper.google.search' and maps the organic results to a simplified format.
    handle: async (params, client) => { return wrapMcpResponse(async () => { const data: any = await client.deepserp.scrape({ actor: "scraper.google.search", input: params, }); return ( data?.organic_results?.map((i: any) => ({ position: i.position, title: i.title, link: i.link, redirect_link: i.redirect_link, snippet: i.snippet, snippet_highlighted_words: i.snippet_highlighted_words, source: i.source, })) ?? [] ); }); },
  • Input schema using Zod defining parameters q (search query), hl (language), gl (country) with descriptions and defaults.
    inputSchema: { q: z .string() .describe( "Parameter defines the query you want to search. You can use anything that you would use in a regular Google search. e.g. inurl:, site:, intitle:. We also support advanced search query parameters such as as_dt and as_eq." ) .default("Top news headlines"), hl: z .string() .describe( "Parameter defines the language to use for the Google search. It's a two-letter language code. (e.g., en for English, es for Spanish, or fr for French)." ) .default("en"), gl: z .string() .describe( "Parameter defines the country to use for the Google search. It's a two-letter country code. (e.g., us for the United States, uk for United Kingdom, or fr for France)." ) .default("us"), },
  • src/server.ts:40-45 (registration)
    Registers all tools from the toolsList import (including the google_search tool) into the MCP server using server.tool.
    // tools registration Object.values(toolsList).forEach((tool) => { server.tool(tool.name, tool.description, tool.inputSchema, (params: any) => tool.handle(params, getScrapelessClient()) ); });
  • src/tools/index.ts:1-1 (registration)
    Re-exports the googleSearch tool definition, including it in the toolsList used for MCP server registration.
    export * from "./deepserp/googleSearch.js";

Other Tools

Related 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/scrapeless-ai/scrapeless-mcp-server'

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