Skip to main content
Glama

searchconsole.searchanalytics.query

Query Google Search Console performance data by date range and dimensions; apply filters to retrieve grouped search analytics rows as JSON.

Instructions

Query your data with filters and parameters that you define. Returns zero or more rows grouped by the row keys that you define. You must define a date range of one or more days. When date is one of the group by values, any days without data are omitted from the result list. If you need to know which days have data, issue a broad date range query grouped by date for any metric, and see which day rows are returned [HTTP POST] — creates or triggers a change; refused under --readonly safety profiles. Returns the API's response resource as JSON — request body is a JSON SearchAnalyticsQueryRequest object accepting aggregationType, dataState, dimensionFilterGroups, dimensions, endDate, rowLimit, searchType, startDate and 2 more fields; pass it via params or whole via body_file

Input Schema

NameRequiredDescriptionDefault
queryNoExtra KEY=VALUE query pairs for endpoints whose parameters Discovery does not describe.
paramsNoParameter map merged into the request; typed parameters win.
dry_runNoReturn the request that would be sent, without sending it.
siteUrlYes[URL path segment] The site's URL, including protocol. For example: `http://www.example.com/`.
body_fileNoRead the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON SearchAnalyticsQueryRequest object.
request_bodyNoRequest body of type SearchAnalyticsQueryRequest: pass it via `params` (merged into the built body) or whole via `body_file`.

Output Schema

NameRequiredDescriptionDefault
rowsNo
metadataNo
responseAggregationTypeNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / body_file / description
      Previous value: -"Read the request body from this file ('-' for stdin) instead of building one from the parameters."New value: +"Read the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON SearchAnalyticsQueryRequest object."
    • addedInput schema / properties / request_body
      Added value: +{
      +  "description": "Request body of type SearchAnalyticsQueryRequest: pass it via `params` (merged into the built body) or whole via `body_file`.",
      +  "properties": {
      +    "aggregationType": {
      +      "enum": [
      +        "AUTO",
      +        "BY_PROPERTY",
      +        "BY_PAGE",
      +        "BY_NEWS_SHOWCASE_PANEL"
      +      ],
      +      "type": "string"
      +    },
      +    "dataState": {
      +      "enum": [
      +        "DATA_STATE_UNSPECIFIED",
      +        "FINAL",
      +        "ALL",
      +        "HOURLY_ALL"
      +      ],
      +      "type": "string"
      +    },
      +    "dimensionFilterGroups": {
      +      "items": {
      +        "properties": {
      +          "filters": {
      +            "items": {
      +              "properties": {
      +                "dimension": {
      +                  "enum": [
      +                    "QUERY",
      +                    "PAGE",
      +                    "COUNTRY",
      +                    "DEVICE",
      +                    "SEARCH_APPEARANCE"
      +                  ],
      +                  "type": "string"
      +                },
      +                "expression": {
      +                  "type": "string"
      +                },
      +                "operator": {
      +                  "enum": [
      +                    "EQUALS",
      +                    "NOT_EQUALS",
      +                    "CONTAINS",
      +                    "NOT_CONTAINS",
      +                    "INCLUDING_REGEX",
      +                    "EXCLUDING_REGEX"
      +                  ],
      +                  "type": "string"
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "groupType": {
      +            "enum": [
      +              "AND"
      +            ],
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "dimensions": {
      +      "items": {
      +        "enum": [
      +          "DATE",
      +          "QUERY",
      +          "PAGE",
      +          "COUNTRY",
      +          "DEVICE",
      +          "SEARCH_APPEARANCE",
      +          "HOUR"
      +        ],
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "endDate": {
      +      "type": "string"
      +    },
      +    "rowLimit": {
      +      "type": "integer"
      +    },
      +    "searchType": {
      +      "enum": [
      +        "WEB",
      +        "IMAGE",
      +        "VIDEO",
      +        "NEWS",
      +        "DISCOVER",
      +        "GOOGLE_NEWS"
      +      ],
      +      "type": "string"
      +    },
      +    "startDate": {
      +      "type": "string"
      +    },
      +    "startRow": {
      +      "type": "integer"
      +    },
      +    "type": {
      +      "enum": [
      +        "WEB",
      +        "IMAGE",
      +        "VIDEO",
      +        "NEWS",
      +        "DISCOVER",
      +        "GOOGLE_NEWS"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed2 schema fields changed
    • changedInput schema / properties / siteUrl / description
      Previous value: -"The site's URL, including protocol. For example: `http://www.example.com/`."New value: +"[URL path segment] The site's URL, including protocol. For example: `http://www.example.com/`."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "metadata": {
      +      "properties": {
      +        "firstIncompleteDate": {
      +          "type": "string"
      +        },
      +        "firstIncompleteHour": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "responseAggregationType": {
      +      "enum": [
      +        "AUTO",
      +        "BY_PROPERTY",
      +        "BY_PAGE",
      +        "BY_NEWS_SHOWCASE_PANEL"
      +      ],
      +      "type": "string"
      +    },
      +    "rows": {
      +      "items": {
      +        "properties": {
      +          "clicks": {
      +            "type": "number"
      +          },
      +          "ctr": {
      +            "type": "number"
      +          },
      +          "impressions": {
      +            "type": "number"
      +          },
      +          "keys": {
      +            "items": {
      +              "type": "string"
      +            },
      +            "type": "array"
      +          },
      +          "position": {
      +            "type": "number"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observed

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations supplied, the description carries the burden and does disclose two non-obvious behaviors: the call is an HTTP POST despite being a read-style query, and it is 'refused under --readonly safety profiles'. It also explains that the response resource comes back as JSON and how the body may be supplied. Missing are cost/quota, pagination (startRow/rowLimit interaction), and auth/scope requirements.

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

Conciseness3/5

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

The opening sentences are front-loaded and useful, but the trailing block is boilerplate-heavy and partly redundant ('Returns the API's response resource as JSON' recurs) and mixes upstream API docs with harness-generated text. It is readable but not tight; several clauses could be dropped without loss.

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?

For a complex, nested-body query endpoint with an output schema present, the description covers the required date range, the POST/readonly gate, and how to pass the body — enough for an agent to invoke it correctly. It could be more complete about pagination limits (rowLimit/startRow) and the meaning of omitted zero-data days at scale, but nothing critical is absent.

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 description coverage is 100% and the nested request body is fully documented with enums, so the schema does the heavy lifting. The description adds only the merge-passing mechanics ('pass it via `params` or whole via `body_file`, typed parameters win' style) and enumerates body fields already present in the schema. Baseline 3 is appropriate.

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 names a concrete operation and output shape: it queries data with caller-defined filters/parameters and returns rows grouped by caller-defined row keys. Combined with the tool name, an agent knows this is the Search Console search analytics report endpoint. It falls short of 5 because 'your data' is vague in isolation and it never names a sibling it differs from (e.g., searchconsole.urlInspection.index.inspect or analyticsdata.properties.runReport).

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 states a hard prerequisite ('You must define a date range of one or more days') and gives operational guidance for discovering which days have data via a broad date-range query grouped by date. That is real when/how guidance rather than mere restatement. No explicit when-not-use or alternative-tool routing is provided, which keeps it below 5.

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

Deploy Server

Other Tools