Compare a site migration (A vs B)
compare_migrationUse this when the user asks whether a site migration, domain move or restructure lost or gained traffic: a before/after Search Console comparison. Three modes: "cross-property" compares two GSC properties (old domain vs new); "two-urls" compares two URL-prefix sections within one property; "regex" splits one property by two regexes. Returns the daily clicks/impressions trend for each side (date order), per-side totals (avgCtr 0-100) and the query and page winners and losers by click delta (topGainers by clicksDelta descending, topLosers ascending: biggest loss first). Without goLiveDate both sides share one date window (startDate/endDate). With goLiveDate it becomes a before/after comparison around the launch: side A is read over the before window and side B over the after window, placed by windowStrategy ("recent", the default: the last windowDays settled days vs the windowDays before go-live; "from-go-live": the first windowDays from go-live vs the windowDays before; "full": the 90 days before go-live vs every day since). windowDays defaults to 28; yoyBaseline compares with the same weeks a year earlier instead. The go-live result adds windows (dates, days since go-live, warnings), recoveryPct (B clicks per day as a % of A clicks per day; null under 10 baseline clicks) and trend buckets (lost, declined, stable, improved, new) for queries and pages; pages of two properties are joined by path. Not for the health verdict (risk score, redirect checks, recommendations, projected recovery): use get_migration_health. Query figures cover only the queries Google lists, so they describe visible queries, not the whole site (analyze_sampling_impact measures the gap). Reads the ClickHouse warehouse when available, else the live Search Console API. Query and page lists cover at most the top 25,000 rows by clicks per side; truncated / truncationNote flag a reached cap. Regexes are capped at 2,000 characters and must not nest quantifiers (for example (a+)+). Date range is optional: omit startDate/endDate to analyze the last 28 settled days (data lags ~2-3 days).
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": {
"mode": "<mode>",
"siteUrl": "<siteUrl>"
},
"name": "compare_migration"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | cross-property | two-urls | regex. | |
| limit | No | Max query/page winners and losers to return per list (default 50). | |
| regexA | No | Side A page regex (required for regex mode). | |
| regexB | No | Side B page regex (required for regex mode). | |
| endDate | No | Optional. Window end as YYYY-MM-DD (e.g. 2026-05-31). You do NOT need to know today's date or the latest available date: omit this and the server uses the latest settled Search Console date (data lags ~2-3 days behind today). Never pass null or the string "null". | |
| siteUrl | Yes | Side A property (and the single property for two-urls/regex). | |
| siteUrlB | No | Side B property (required for cross-property). | |
| startDate | No | Optional. Window start as YYYY-MM-DD (e.g. 2026-05-03). You do NOT need to know today's date. Omit BOTH startDate and endDate to analyze the last 28 settled days automatically (Search Console data lags ~2-3 days). Never pass null or the string "null". | |
| goLiveDate | No | Optional. First day the new setup was live, as YYYY-MM-DD. When given, side A is read over the before window and side B over the after window around this date (see windowStrategy), and the result adds windows, recoveryPct and trend buckets. Do not combine with startDate/endDate. | |
| urlPrefixA | No | Side A URL prefix (required for two-urls): a full URL ("https://acme.com/old-blog/"), a host ("blog.acme.com/") or a path on any host ("/old-blog/"), as list_migrations returns them. | |
| urlPrefixB | No | Side B URL prefix (required for two-urls), in the same forms as urlPrefixA. | |
| windowDays | No | Only with goLiveDate. Window length in days for "recent" and "from-go-live" (default 28). Shortened to the post-launch days available. | |
| yoyBaseline | No | Only with goLiveDate. Compare the after window with the same weeks one year (364 days) earlier instead of the days before go-live, which removes seasonality. Default false. | |
| windowStrategy | No | Only with goLiveDate. "recent" (default): the last windowDays days vs the windowDays days before go-live, where the migration stands now. "from-go-live": the first windowDays days after go-live vs the windowDays days before, the launch dip included. "full": the 90 days before go-live vs every day since (lengths differ; per-day figures and recovery stay comparable). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | ||
| note | No | ||
| pages | No | ||
| range | No | ||
| sides | No | ||
| thenBy | No | ||
| listKey | No | Name of the top-level field that holds the rows sortedBy describes. | |
| queries | No | ||
| summary | No | ||
| windows | No | ||
| nextStep | No | ||
| ordering | No | ||
| sortedBy | No | ||
| sortOrder | No | ||
| thenOrder | No | ||
| truncated | No | ||
| dailyTrend | No | ||
| dataSource | No | ||
| recoveryPct | No | ||
| emptyBecause | No | ||
| methodLimits | No | ||
| recoveryNote | No | ||
| truncationNote | No |