Skip to main content
Glama

ROAZ Meta and Google Ads Analytics

Compare two periods

comparePeriods
Read-onlyIdempotent

Compare 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

NameRequiredDescriptionDefault
limitNoMax rows to return (default 25, hard cap 100).
presetNo"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".
endDateNoEnd date, YYYY-MM-DD (inclusive). Defaults to yesterday in the ad account's time zone.
networkNoAd network. Default "meta". "google" reads the Google Ads accounts (ids look like google:<n> in listAdAccounts).
startDateNoStart date, YYYY-MM-DD. Give both dates or neither (default: the last 7 complete days). Max 400 days.
adAccountIdYesWhich account to query: the numeric ROAZ ad account id, a Meta act_ id, or a client name (fuzzy-matched). Required.
compareEndDateNoExplicit baseline end, YYYY-MM-DD.
compareStartDateNoExplicit baseline start, YYYY-MM-DD. Overrides the preset baseline.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

The read-only annotations already cover the safety profile, yet the description adds genuinely non-obvious behavior: a change is null when the baseline is zero, when the comparison window predates synced history, or when unequal-length windows are compared for totals like spend. Those are exactly the conditions under which an agent would otherwise misreport a delta, and they add real context beyond the annotations.

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

Conciseness5/5

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

Two tightly written sentences: the capability and return shape first, the correctness caveat second. Every clause carries information, and the most consequential instruction (check coverage) is placed where it will be read before quoting results.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description must carry return-value information and does: both KPI sets, absolute and percent change, top-moving campaigns, and the `coverage` field. For an 8-parameter read-only comparison tool, nothing an agent needs in order to call it or interpret a null delta is missing.

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%, with presets, date semantics, and network ids all documented in the schema itself. The description only echoes the range concept at a high level and adds no syntax or format detail beyond it, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (compare an account between two windows) plus the three comparison modes and what comes back (both KPI sets with absolute and % change, top-moving campaigns). Unlike sibling tools such as getAccountOverview or getAccountReport, it is unambiguously a two-window comparison, so an agent can pick it without opening the schema.

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?

The comparison framing plus the explicit precondition 'check `coverage` before quoting a change' tells the agent when this tool is appropriate and when its output is not quotable. It stops short of naming a sibling for single-window reporting or stating exclusions, so it falls short of a full when/when-not/alternative statement.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources