compare_periods
Compare one summarized search/SEO result with a prior period — week vs previous week, month-over-month, or "vs last year" — and return per-row deltas and percentage changes. For whole-site clicks, impressions, CTR, or average position versus another period, call search_performance with date_range, metrics, and comparison_range instead. Use this tool only when find_relevant_analysis supplies a dataset and fully-qualified fields. NEVER use this tool when the request asks for a day/week/month/quarter series BY page, country, device, category, intent, query, rank bucket, traffic source, language, or geo; that shape must call gsc_dimensional_trend exactly once with both date_range and comparison_range so both bucketed periods use the same stable entity set.
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": {
"dataset": "<dataset>",
"fields": "<fields>",
"filters": "<filters>",
"comparison_period": "<comparison_period>"
},
"name": "compare_periods"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| fields | Yes | Fully-qualified field ids copied from find_relevant_analysis, shaped "<dataset>.<field>". Bare names such as "clicks" or "impressions" are rejected. | |
| source | No | Where Google search performance data is read from. Use "bigquery" ONLY when the user explicitly asks for BigQuery as the source AND describe_data_sources reports it available from live customer configuration — it returns far more granular per-query data (privacy-suppressed impressions appear under "[anonymized by google]"). | default |
| dataset | Yes | Dataset name copied from find_relevant_analysis. Never pass another tool name such as search_performance. | |
| filters | Yes | Must include a key ending in ".selected_period" set to the selected inclusive date range, for example "<dataset>.selected_period" = "2026-08-01 to 2026-08-31". A ".date" key is not accepted. | |
| comparison_period | Yes | Explicit date range for the comparison period, e.g. "2026-04-01 to 2026-04-30". INCLUSIVE of both endpoints. | |
| period_filter_prefix | No | Prefix of the selected_period filter to swap; defaults to the dataset name |