Skip to main content
Glama
Decodo

Decodo MCP Server

google_ai_mode

Read-only

Scrape Google AI Mode search results with automatic parsing. Supports geo and device customization for targeted extraction.

Instructions

Scrape Google AI Mode (Search with AI) results with automatic parsing

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query for Google AI Mode (e.g., "What are the top three dog breeds?")
geoNoGeo location for AI mode search (e.g., "us", "uk")
deviceTypeNoDevice type to emulate for the request

Implementation Reference

  • The GoogleAiModeTool class that contains the full handler logic for executing the 'google_ai_mode' tool. It registers the tool with input schema (query, geo, deviceType), builds params with target=GOOGLE_AI_MODE, calls sapiClient.scrape(), and returns the scraped data.
    export class GoogleAiModeTool extends Tool {
      toolset = TOOLSET.AI;
    
      transformResponse = ({ data }: { data: object }) => {
        return { data: JSON.stringify(data) };
      };
    
      register = ({ server, sapiClient, auth }: ToolRegistrationArgs) => {
        server.registerTool(
          'google_ai_mode',
          {
            description: 'Scrape Google AI Mode (Search with AI) results with automatic parsing',
            inputSchema: {
              query: z.string().describe('Search query for Google AI Mode (e.g., "What are the top three dog breeds?")'),
              geo: zodGeo,
              deviceType: zodDeviceType,
            },
            annotations: {
              readOnlyHint: true,
              openWorldHint: true,
            },
          },
          async (scrapingParams: ScrapingMCPParams, extra: ProgressExtra) => {
            const params = {
              ...scrapingParams,
              target: SCRAPER_API_TARGETS.GOOGLE_AI_MODE,
              parse: true,
            } satisfies ScraperAPIParams;
    
            const { data } = await sapiClient.scrape<object>({ auth, scrapingParams: params, extra });
    
            return {
              content: [
                {
                  type: 'text',
                  text: JSON.stringify(data),
                },
              ],
            };
          }
        );
      };
    }
  • The input schema definition for the google_ai_mode tool: 'query' (string), 'geo' (optional string with description), and 'deviceType' (from zodDeviceType). The output is a text response with JSON-stringified data.
    register = ({ server, sapiClient, auth }: ToolRegistrationArgs) => {
      server.registerTool(
        'google_ai_mode',
        {
          description: 'Scrape Google AI Mode (Search with AI) results with automatic parsing',
          inputSchema: {
            query: z.string().describe('Search query for Google AI Mode (e.g., "What are the top three dog breeds?")'),
            geo: zodGeo,
            deviceType: zodDeviceType,
          },
          annotations: {
            readOnlyHint: true,
            openWorldHint: true,
          },
        },
  • Registration of GoogleAiModeTool in the allTools array within SapiBaseServer, which instantiates the tool so it gets registered with the MCP server.
    static allTools: Tool[] = [
      new ScrapeAsMarkdownTool(),
      new ScreenshotTool(),
      new GoogleSearchTool(),
      new GoogleAdsTool(),
      new GoogleLensTool(),
      new GoogleAiModeTool(),
  • Imports and the zodGeo helper schema used for geo location parameter validation.
    import z from 'zod';
    import { ScraperAPIParams, ScrapingMCPParams } from 'types';
    import { SCRAPER_API_TARGETS, TOOLSET } from '../../constants';
    import { zodDeviceType } from '../../zod/zod-types';
    import { Tool, ToolRegistrationArgs } from '../tool';
    import { ProgressExtra } from '../../utils';
    
    const zodGeo = z
      .string()
      .describe('Geo location for AI mode search (e.g., "us", "uk")')
      .optional();
  • SCRAPER_API_TARGETS enum defining GOOGLE_AI_MODE = 'google_ai_mode', which is used as the target parameter when scraping.
    export enum SCRAPER_API_TARGETS {
      GOOGLE_SEARCH = 'google_search',
      GOOGLE_TRAVEL_HOTELS = 'google_travel_hotels',
      GOOGLE_ADS = 'google_ads',
      GOOGLE_LENS = 'google_lens',
      GOOGLE_AI_MODE = 'google_ai_mode',
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so the description adds 'automatic parsing' which hints at structured output. However, no additional behavioral details like rate limits, authentication, or parsing specifics are provided.

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?

Single sentence with no wasted words. Front-loaded with action and resource, then adds feature. Highly efficient.

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

Completeness4/5

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

Description covers the main purpose and parsing feature, but does not explain what 'automatic parsing' produces or how results are structured. Given the lack of output schema, a bit more detail would improve completeness.

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 coverage is 100%, so the schema already documents all three parameters with descriptions. The tool description does not add parameter-specific meaning beyond what the schema provides, warranting the baseline score of 3.

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

Purpose5/5

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

Description clearly states action 'Scrape' and specific resource 'Google AI Mode (Search with AI) results' with a feature 'automatic parsing'. This distinguishes it from siblings like 'google_search' which likely scrapes regular search results.

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

Usage Guidelines3/5

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

The description implies use for AI mode scraping but provides no explicit conditions, exclusions, or comparisons with siblings like 'google_search' or 'perplexity'. Usage context is only implied.

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

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/Decodo/mcp-server'

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