Skip to main content
Glama
Decodo

Decodo MCP Server

google_ads

Read-only

Extract Google Ads search results for any query, location, and device type with automatic parsing.

Instructions

Scrape Google Ads search results with automatic parsing

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query for Google Ads (e.g., "laptop")
geoNoGeolocation of the desired request, expressed as a country name
localeNoLocale of the desired request
jsRenderNoShould the request be opened in a headless browser, false by default
deviceTypeNoDevice type to emulate for the request
pageFromNoStarting page number for pagination

Implementation Reference

  • The GoogleAdsTool class extends Tool and contains the full handler logic. The register method (lines 26-65) defines the tool 'google_ads', sets up the input schema, and implements the async handler that sends scraping params (with target=GOOGLE_ADS) to the Scraper API and transforms the response by removing 'url' fields.
    export class GoogleAdsTool extends Tool {
      toolset = TOOLSET.SEARCH;
    
      private static FIELDS_WITH_HIGH_CHAR_COUNT = ['url'];
    
      transformResponse = ({ data }: { data: object }) => {
        for (const fieldToRemove of GoogleAdsTool.FIELDS_WITH_HIGH_CHAR_COUNT) {
          data = removeKeyFromNestedObject({ obj: data, keyToRemove: fieldToRemove });
        }
    
        return { data: JSON.stringify(data) };
      };
    
      register = ({ server, sapiClient, auth }: ToolRegistrationArgs) => {
        server.registerTool(
          'google_ads',
          {
            description: 'Scrape Google Ads search results with automatic parsing',
            inputSchema: {
              query: z.string().describe('Search query for Google Ads (e.g., "laptop")'),
              geo: zodGeo,
              locale: zodLocale,
              jsRender: zodJsRender,
              deviceType: zodDeviceType,
              pageFrom: zodPageFrom,
            },
            annotations: {
              readOnlyHint: true,
              openWorldHint: true,
            },
          },
          async (scrapingParams: ScrapingMCPParams, extra: ProgressExtra) => {
            const params = {
              ...scrapingParams,
              target: SCRAPER_API_TARGETS.GOOGLE_ADS,
              parse: true,
            } satisfies ScraperAPIParams;
    
            const { data } = await sapiClient.scrape<object>({ auth, scrapingParams: params, extra });
    
            const { data: text } = this.transformResponse({ data });
    
            return {
              content: [
                {
                  type: 'text',
                  text,
                },
              ],
            };
          }
        );
      };
    }
  • Input schema for the google_ads tool: 'query' (string), 'geo', 'locale', 'jsRender', 'deviceType' (imported from zod-types), and 'pageFrom' (optional number for pagination).
    const zodPageFrom = z
      .number()
      .describe('Starting page number for pagination')
      .optional();
  • GoogleAdsTool is instantiated in the allTools array (line 70) and registered via registerAllTools/registerTools methods (lines 99-117) which call tool.register() on each tool, ultimately registering 'google_ads' with the MCP server.
    static allTools: Tool[] = [
      new ScrapeAsMarkdownTool(),
      new ScreenshotTool(),
      new GoogleSearchTool(),
      new GoogleAdsTool(),
      new GoogleLensTool(),
      new GoogleAiModeTool(),
      new GoogleTravelHotelsTool(),
      new AmazonSearchTool(),
      new AmazonProductTool(),
      new AmazonPricingTool(),
      new AmazonSellersTool(),
      new AmazonBestsellersTool(),
      new WalmartSearchTool(),
      new WalmartProductTool(),
      new TargetSearchTool(),
      new TargetProductTool(),
      new TiktokPostTool(),
      new TiktokShopSearchTool(),
      new TiktokShopProductTool(),
      new TiktokShopUrlTool(),
      new YoutubeMetadataTool(),
      new YoutubeChannelTool(),
      new YoutubeSubtitlesTool(),
      new YoutubeSearchTool(),
      new RedditPostTool(),
      new RedditSubredditTool(),
      new RedditUserTool(),
      new BingSearchTool(),
      new ChatGPTTool(),
      new PerplexityTool(),
    ];
    
    registerTools({ toolsets }: { toolsets: TOOLSET[] }) {
      if (toolsets.length === 0) {
        this.registerAllTools();
        return;
      }
    
      for (const toolset of toolsets) {
        const tools = ScraperAPIBaseServer.allTools.filter(tool => tool.toolset === toolset);
        for (const tool of tools) {
          tool.register({ server: this.server, sapiClient: this.sapiClient, auth: this.auth });
        }
      }
    }
    
    registerAllTools() {
      for (const tool of ScraperAPIBaseServer.allTools) {
        tool.register({ server: this.server, sapiClient: this.sapiClient, auth: this.auth });
      }
    }
  • The transformResponse helper method (lines 18-24) post-processes scraped data by removing 'url' fields (FIELDS_WITH_HIGH_CHAR_COUNT) from nested objects to reduce character count, then stringifies the result.
    private static FIELDS_WITH_HIGH_CHAR_COUNT = ['url'];
    
    transformResponse = ({ data }: { data: object }) => {
      for (const fieldToRemove of GoogleAdsTool.FIELDS_WITH_HIGH_CHAR_COUNT) {
        data = removeKeyFromNestedObject({ obj: data, keyToRemove: fieldToRemove });
      }
    
      return { data: JSON.stringify(data) };
    };
Behavior3/5

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

Annotations indicate readOnlyHint and openWorldHint, which are consistent with the 'scrape' action. The description does not add further behavioral details beyond what annotations already provide.

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 filler. Every word is meaningful and concise.

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?

No output schema exists, yet the description fails to explain what the parsed results look like. For a tool with 6 parameters, more context on expected output or usage scenarios is needed.

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 description does not need to add parameter details. The phrase 'automatic parsing' hints at output structure but does not explain parameters beyond the schema.

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 scrapes Google Ads search results with automatic parsing, but does not differentiate it from sibling tools like google_search, which may perform similar functions for organic results.

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?

No guidance on when to use this tool versus alternatives such as google_search. No exclusions or context provided for selection.

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