Skip to main content
Glama

openapi_v2_webtools_search

Search the web

Search the web. Two modes governed by scrapeOptions.

  • Omit scrapeOptions → SERP-only: returns the search engine's raw snippets (url + meta with title / description / source / publishedAt / imageUrl*). No per-page fetch, fast and cheap.

  • Pass scrapeOptions: {} → deep-scrape every result, return page-faithful Markdown under markdown.

  • Pass scrapeOptions: {"format": "json"} → deep-scrape every result, return the structured page summary under json (same shape as /webtools/scrape's json field).

In deep-scrape mode, results where the chosen format produced no content are dropped from the response, so the response may hold fewer than limit results. meta.statusCode carries the fetched page's HTTP status when deep-scraped.

query is compatible with common Google search-operator syntax: site:, intitle:, filetype:, "exact phrase", -exclude. To filter by whole domains, prefer the structured includeDomains / excludeDomains — they are folded into the matching site: / -site: operators (and may be combined, e.g. include a parent domain while excluding one subdomain).

Use sources to pick the result bucket — "web" (default), "news", or "images" (combinable); tbs for a time filter (qdr:d / qdr:w / qdr:m / qdr:y); limit (1-20, default 10) to cap results.

Billing scales with the number of results returned, with a minimum of 1 credit per call (an empty result set still bills the minimum).

Responses:

200: Successful Response (Success Response) Content-Type: application/json

Example Response:

{
  "success": true,
  "meta": {
    "requestId": "Requestid",
    "timestamp": "Timestamp"
  }
}

Output Schema:

{
  "properties": {
    "success": {
      "type": "boolean",
      "title": "Success",
      "description": "Whether the request was successful",
      "default": true
    },
    "data": {
      "description": "Response data payload"
    },
    "error": {
      "description": "Error details if request failed"
    },
    "meta": {
      "description": "Metadata for API responses.\n\nCredit fields follow the ADR-0003 parallel-fields strategy (Option 3):\n- `credits_remaining` / `credits_consumed` (int): legacy fields, rounded\n  to whole credits, kept for zero-breaking-change to existing SDK clients.\n- `credits_remaining_exact` / `credits_consumed_exact` (float): new\n  precision-aware fields for clients that opt in to decimal credits.\n\nSee ADR-0003 decision 5 and the \u00a78 deprecation timeline.\n\nTODO(2026-11, ADR-0003 \u00a78 +6mo): mark `credits_remaining` /\n`credits_consumed` as `deprecated=True` in their Field() definitions\nand announce in customer changelog.\nTODO(2027-05, ADR-0003 \u00a78 +12mo): remove the legacy int fields via a\nmajor-version bump of the OpenAPI surface.",
      "properties": {
        "requestId": {
          "type": "string",
          "title": "Requestid",
          "description": "Unique request identifier"
        },
        "timestamp": {
          "type": "string",
          "title": "Timestamp",
          "description": "Response timestamp in ISO 8601 format"
        },
        "total": {
          "title": "Total",
          "description": "Total number of records"
        },
        "page": {
          "title": "Page",
          "description": "Current page number"
        },
        "pageSize": {
          "title": "Pagesize",
          "description": "Number of records per page"
        },
        "totalPages": {
          "title": "Totalpages",
          "description": "Total number of pages"
        },
        "creditsRemaining": {
          "title": "Creditsremaining",
          "description": "Remaining API credits (rounded to whole credits; see creditsRemainingExact for precise value)"
        },
        "creditsConsumed": {
          "title": "Creditsconsumed",
          "description": "Credits consumed by this request (rounded; see creditsConsumedExact for precise value)"
        },
        "creditsRemainingExact": {
          "title": "Creditsremainingexact",
          "description": "Remaining API credits, precise to 1 decimal place"
        },
        "creditsConsumedExact": {
          "title": "Creditsconsumedexact",
          "description": "Credits consumed by this request, precise to 1 decimal place"
        },
        "tokensUsage": {
          "description": "Provider token-usage block \u2014 populated on terminal video polls only, null on every non-video endpoint. See TokensUsage for its fields."
        }
      },
      "type": "object",
      "required": [
        "requestId",
        "timestamp"
      ],
      "title": "ResponseMeta"
    }
  },
  "type": "object",
  "required": [
    "meta"
  ],
  "title": "OpenApiResponse[CrawlerSearch]",
  "examples": []
}

422: Validation Error Content-Type: application/json

Example Response:

{
  "detail": [
    {
      "loc": [],
      "msg": "Message",
      "type": "Error Type",
      "ctx": {}
    }
  ]
}

Output Schema:

{
  "properties": {
    "detail": {
      "items": {
        "properties": {
          "loc": {
            "items": {},
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "type": "array",
      "title": "Detail"
    }
  },
  "type": "object",
  "title": "HTTPValidationError"
}

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tbsNoTime-based result filter using the ``qdr:`` syntax: ``qdr:d`` (past day), ``qdr:w`` (week), ``qdr:m`` (month), ``qdr:y`` (year). Omit for no time restriction.
limitNoMaximum number of results to return (1-20). Default 10.
queryYesSearch query. Compatible with common Google search-operator syntax, inline: ``site:`` (domain), ``intitle:``, ``filetype:``, ``"exact phrase"``, ``-exclude``. To filter by whole domains, prefer ``includeDomains`` / ``excludeDomains`` instead of hand-writing ``site:``.
sourcesNoResult bucket(s). Allowed values: ``"web"``, ``"news"``, ``"images"``. Defaults to ``["web"]``; combine multiple buckets in one call to merge their results.
scrapeOptionsNoDeep-scrape options. Omit (or pass ``null``) to return **SERP results only** (fast, no per-page fetch — useful when you only need the result list). Pass ``{}`` to deep-scrape every result with default ``format=markdown``. Pass ``{"format": "json"}`` to deep-scrape with structured extraction.
excludeDomainsNoExclude results from these domains (bare hostnames only, e.g. ``pinterest.com``). Folded into ``-site:`` operators. May be combined with ``includeDomains``. Max 20.
includeDomainsNoRestrict results to these domains (bare hostnames only, e.g. ``github.com``). Folded into ``site:`` operators; multiple domains are OR-combined. May be used together with ``excludeDomains`` (e.g. include a parent domain, exclude one subdomain). Max 20.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / scrapeOptions
      Added value: +{
      +  "anyOf": [
      +    {
      +      "additionalProperties": false,
      +      "description": "Per-result deep-scrape options for ``/webtools/search``.\n\nPresence of this object on the search request triggers deep-scraping each\nresult page; omit (or pass ``null``) to get **SERP-only** results (CA's raw\nsearch snippets — no per-page fetch, fast and cheap).",
      +      "properties": {
      +        "format": {
      +          "default": "markdown",
      +          "description": "Content format per scraped result. ``markdown`` (default) returns page-faithful Markdown; ``json`` returns the structured page summary (same shape as ``/webtools/scrape``'s ``json`` field — dispatch on ``page_type``). ``rawHtml`` is not supported on search.",
      +          "enum": [
      +            "markdown",
      +            "json"
      +          ],
      +          "title": "Format",
      +          "type": "string"
      +        }
      +      },
      +      "title": "SearchScrapeOptions",
      +      "type": "object"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Deep-scrape options. Omit (or pass ``null``) to return **SERP results only** (fast, no per-page fetch — useful when you only need the result list). Pass ``{}`` to deep-scrape every result with default ``format=markdown``. Pass ``{\"format\": \"json\"}`` to deep-scrape with structured extraction.",
      +  "title": "scrapeOptions",
      +  "type": "object"
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum number of results to return (1-100). Default 10."New value: +"Maximum number of results to return (1-20). Default 10."
    • changedInput schema / properties / limit / maximum
      Previous value: -100New value: +20
  3. Changed7 schema fields changed
    • removedInput schema / properties / country
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "description": "ISO 3166-1 α2 country code (e.g. 'us'). Google ``gl``.",
      -  "title": "country",
      -  "type": "string"
      -}
    • addedInput schema / properties / excludeDomains
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "maxItems": 20,
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Exclude results from these domains (bare hostnames only, e.g. ``pinterest.com``). Folded into ``-site:`` operators. May be combined with ``includeDomains``. Max 20.",
      +  "title": "excludeDomains",
      +  "type": "array"
      +}
    • addedInput schema / properties / includeDomains
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "maxItems": 20,
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "Restrict results to these domains (bare hostnames only, e.g. ``github.com``). Folded into ``site:`` operators; multiple domains are OR-combined. May be used together with ``excludeDomains`` (e.g. include a parent domain, exclude one subdomain). Max 20.",
      +  "title": "includeDomains",
      +  "type": "array"
      +}
    • removedInput schema / properties / lang
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "description": "BCP-47 language tag (e.g. 'en', 'zh'). Google ``hl``.",
      -  "title": "lang",
      -  "type": "string"
      -}
    • changedInput schema / properties / limit / description
      Previous value: -"Maximum results. Google ``num``."New value: +"Maximum number of results to return (1-100). Default 10."
    • changedInput schema / properties / query / description
      Previous value: -"Search query. Supports Google operators (site:, intitle:, etc.)."New value: +"Search query. Compatible with common Google search-operator syntax, inline: ``site:`` (domain), ``intitle:``, ``filetype:``, ``\"exact phrase\"``, ``-exclude``. To filter by whole domains, prefer ``includeDomains`` / ``excludeDomains`` instead of hand-writing ``site:``."
    • changedInput schema / properties / tbs / description
      Previous value: -"Time-based filter using Google syntax (e.g. 'qdr:d', 'qdr:w', 'qdr:m', 'qdr:y')."New value: +"Time-based result filter using the ``qdr:`` syntax: ``qdr:d`` (past day), ``qdr:w`` (week), ``qdr:m`` (month), ``qdr:y`` (year). Omit for no time restriction."
  4. Added

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so thoroughly: it discloses dropped results in deep-scrape mode when content is absent, meta.statusCode behavior, minimum 1-credit billing even for empty results, and folding of domain filters into site: operators. These are meaningful behavioral traits beyond the schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core narrative is front-loaded and uses clear bullet points, making it scannable. However, the embedded response schema — including the verbose ADR-0003 credit-field explanation and TODOs — lengthens the overall definition beyond what is needed for selection and invocation, even though it is relevant context.

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

Completeness5/5

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

Given 7 parameters, nested objects, no annotations, and no formal output schema on the MCP side, the description fully covers all parameters, return shapes, error handling, billing, and mode-specific behavior. An agent can correctly select and invoke this tool without needing additional documentation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although schema coverage is 100%, the description adds substantial semantic value: it explains how scrapeOptions presence triggers deep-scrape, what each format returns, how query operators interoperate with includeDomains/excludeDomains, and how dropped results interact with limit. This far exceeds the schema's own parameter descriptions.

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?

The description opens with 'Search the web' — a specific verb and resource — and immediately distinguishes itself from sibling tools by detailing two modes governed by scrapeOptions. It clearly scopes the tool to web search (SERP or deep-scrape) as opposed to webtools_map, webtools_scrape, or video assets.

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

Usage Guidelines4/5

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

It provides explicit when-to-use guidance for SERP-only vs deep-scrape modes, when to prefer includeDomains/excludeDomains over manual site: operators, and how to configure sources, tbs, and limit. It also hints at alternatives (e.g., rawHtml is not supported on search, referencing /webtools/scrape for the json shape), though it never names a specific sibling as a substitute for a given scenario.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources