Compare two periods
comparePeriodsCompare an account between two windows — week over week, month over month, or any two explicit ranges — returning both sets of KPIs with absolute and % change, plus the campaigns that moved the most. Check coverage before quoting a change: a change is null when the baseline is zero, when the comparison window reaches back before the account's synced history, or (for totals such as spend) when the two windows differ in length.
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": {
"adAccountId": "<adAccountId>"
},
"name": "comparePeriods"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max rows to return (default 25, hard cap 100). | |
| preset | No | "wow" = last 7 complete days vs the 7 before; "mom" = last 30 vs the 30 before; "custom" uses startDate/endDate against the equal-length preceding window. Default "wow". | |
| endDate | No | End date, YYYY-MM-DD (inclusive). Defaults to yesterday in the ad account's time zone. | |
| network | No | Ad network. Default "meta". "google" reads the Google Ads accounts (ids look like google:<n> in listAdAccounts). | |
| startDate | No | Start date, YYYY-MM-DD. Give both dates or neither (default: the last 7 complete days). Max 400 days. | |
| adAccountId | Yes | Which account to query: the numeric ROAZ ad account id, a Meta act_ id, or a client name (fuzzy-matched). Required. | |
| compareEndDate | No | Explicit baseline end, YYYY-MM-DD. | |
| compareStartDate | No | Explicit baseline start, YYYY-MM-DD. Overrides the preset baseline. |