Query Google Search Console search performance
search_console_queryRuns one Google Search Console search performance query for a Hi, Moose project, on the property the user connected in Hi, Moose, and returns the rows plus totals. It takes the same fields as Google's Search Analytics API: startDate, endDate, dimensions (query, page, date, country, device, searchAppearance), searchType, dimensionFilterGroups with Google's six operators, aggregationType, dataState, rowLimit and startRow. Three additions run on the host device. compare (true for the equal window just before, or compareStartDate and compareEndDate) adds each row's previous numbers and the change, and keeps rows that exist in only one period. sortBy and sortDirection order the rows by clicks, impressions, ctr or position, and with a comparison by clicksChange, impressionsChange, ctrChange or positionChange. mergePageFragments adds rows for the same page with a # fragment into the page. For "what dropped", pass compare true, sortBy clicksChange and sortDirection asc. Leave dimensions out for totals only; use dimensions ["date"] for a daily trend. ctr is a fraction (0.042 is 4.2%). position is an average where lower is better. country values are three-letter codes such as usa; device values are DESKTOP, MOBILE and TABLET. Google leaves rare queries out of the rows, so use totals for overall numbers, never the sum of the rows. Days become final about three days later; dataState final leaves out days that are not final. These are Google Search numbers, not AI search. Default 100 rows: ask for what the question needs and page with startRow and the returned nextStartRow. Reads data only; nothing in Search Console changes.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"project": "<project>",
"startDate": "<startDate>",
"endDate": "<endDate>"
},
"name": "search_console_query"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sortBy | No | What to order rows by. Default clicks (Google's own order). The four change fields need a comparison. | |
| compare | No | true: compare with the window of the same length just before startDate. | |
| endDate | Yes | Last day, YYYY-MM-DD. | |
| project | Yes | The Hi, Moose project, by its name as shown by list_projects. The projectId is also accepted. | |
| rowLimit | No | Rows to return. Default 100. A result holds about 850 KB; when the rows do not fit, they are cut and nextStartRow says where to continue. | |
| startRow | No | Rows to skip, for paging. Default 0. | |
| dataState | No | final (default) is final data only; all includes recent days whose numbers still change. | |
| startDate | Yes | First day, YYYY-MM-DD. | |
| dimensions | No | How to group rows. Leave out for totals only. Each row's keys follow this order. | |
| searchType | No | Which search surface (type in Google's API). Default web. | |
| sortDirection | No | desc is largest first, asc is smallest first. Default desc, and asc for position. | |
| compareEndDate | No | Last day of a custom comparison window, YYYY-MM-DD. Needs compareStartDate. | |
| aggregationType | No | How Google adds up numbers. Leave out unless by-page or by-property numbers are needed. | |
| compareStartDate | No | First day of a custom comparison window, YYYY-MM-DD. Needs compareEndDate. | |
| mergePageFragments | No | true: add rows such as /page#section into /page. Needs the page dimension. Default false. | |
| dimensionFilterGroups | No | Filters, in the shape Google uses. Every filter in every group must match. Regex operators use RE2 syntax. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | google-order: one page of rows straight from Google. sorted-on-device: the host device read the rows, then compared, merged or sorted them. | |
| rows | No | ||
| scan | No | For sorted-on-device results: how many rows the host device read from Google. complete false means Google had more rows than were read. | |
| error | No | ||
| jobId | No | ||
| notes | No | Limits that apply to this result. Pass the relevant ones on to the user. | |
| range | No | ||
| sortBy | No | ||
| status | No | done, failed, pending or running. | |
| totals | No | Numbers for the whole range and filters, from Google, including the rare queries the rows leave out. | |
| filters | No | The filters that were applied, after validation. | |
| cutToFit | No | true when fewer rows than rowLimit were returned because of the result size limit. | |
| headline | No | One sentence with the window, sample size and the main numbers. | |
| progress | No | ||
| property | No | The Search Console property that was queried. | |
| returned | No | ||
| rowLimit | No | ||
| startRow | No | ||
| createdAt | No | ||
| dataState | No | ||
| dataNotice | No | ||
| dimensions | No | ||
| durationMs | No | ||
| searchType | No | ||
| projectName | No | ||
| compareRange | No | ||
| nextStartRow | No | Pass as startRow, with the same other fields, for the next rows. null when there are no more. | |
| totalsChange | No | Current period minus comparison period. A negative clicks or impressions change is a drop; a negative position change is an improvement. position is null when the row was missing from one period. | |
| compareTotals | No | ||
| schemaVersion | No | Version of this result shape. Fields are only added within a version. | |
| sortDirection | No | ||
| googleRequests | No | ||
| aggregationType | No | How Google added up the numbers: byPage or byProperty. | |
| mergePageFragments | No |