Skip to main content
Glama
plausible-mcp

plausible-mcp

by getsentry

Compare Periods

compare_periods
Read-onlyIdempotent

Compare metrics between two date ranges side by side, using a baseline and comparison period, to assess before/after deploy impact and period-over-period changes.

Instructions

Compare metrics between two date ranges side by side. Ideal for before/after deploy analysis. period_a is the baseline and period_b is measured against it: deltas are period_b minus period_a, and percent is relative to period_a. To compare a period with the one of the same length right before it, such as this week with last week, pass only period_b ("7d").

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": {
      "site_id": "<site_id>",
      "period_b": "<period_b>"
    },
    "name": "compare_periods"
  }
}

Input Schema

NameRequiredDescriptionDefault
goalNo
pageNo
metricsNo
site_idYes
period_aNoBaseline period. Omit for the equal period immediately before period_b.
period_bYesComparison period, e.g. 7d. Change is period_b minus period_a.
property_filtersNo

Output Schema

NameRequiredDescriptionDefault
notesNo
deltasYesPer-metric change from period_a (baseline) to period_b: absolute is period_b - period_a, percent is that change relative to period_a. A positive value means period_b is higher.
period_aYes
period_bYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed17 schema fields changedv0.14.0
    • removedInput schema / properties / goal / description
      Removed value: -"Filter by goal name (e.g. Signup, Purchase). Do not also target event:goal in property_filters; the call is rejected."
    • removedInput schema / properties / metrics / description
      Removed value: -"Metrics to return. Defaults vary by tool. Plausible rejects these combinations: bounce_rate or visit_duration with event:goal or event:props:<name> dimensions; pageviews, events, scroll_depth or time_on_page with visit:entry_page or visit:exit_page dimensions; views_per_visit with any non-time dimension or a page filter. For goal conversions use get_conversions."
    • removedInput schema / properties / page / description
      Removed value: -"Filter by page path. Exact match by default, use * as trailing wildcard (e.g. /blog*). Do not also target event:page in property_filters; the call is rejected."
    • changedInput schema / properties / period_a / description
      Previous value: -"Baseline (\"before\") date range that deltas are measured from, e.g. \"2024-01-01,2024-01-07\". Omit it to use the period of the same length right before period_b, as Plausible's \"previous period\" does: period_b \"7d\" alone compares the last 7 days with the 7 days before them. The result gives the dates used."New value: +"Baseline period. Omit for the equal period immediately before period_b."
    • removedInput schema / properties / period_a / pattern
      Removed value: -"^(\\d+h|\\d+d|\\d+mo|day|month|year|all|\\d{4}-\\d{2}-\\d{2},\\d{4}-\\d{2}-\\d{2}|\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:Z|[+-]\\d{2}:\\d{2}),\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:Z|[+-]\\d{2}:\\d{2}))$"
    • changedInput schema / properties / period_b / description
      Previous value: -"Date range compared against period_a (\"after\"), e.g. \"2024-01-08,2024-01-14\". For a current-vs-prior comparison, this is the current range; omit period_a to compare it with the period right before it."New value: +"Comparison period, e.g. 7d. Change is period_b minus period_a."
    • removedInput schema / properties / period_b / pattern
      Removed value: -"^(\\d+h|\\d+d|\\d+mo|day|month|year|all|\\d{4}-\\d{2}-\\d{2},\\d{4}-\\d{2}-\\d{2}|\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:Z|[+-]\\d{2}:\\d{2}),\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:Z|[+-]\\d{2}:\\d{2}))$"
    • removedInput schema / properties / property_filters / description
      Removed value: -"Filter results by built-in dimensions or custom event properties, e.g. [{ \"property\": \"visit:channel\", \"operator\": \"is\", \"values\": [\"Organic Search\"] }] or [{ \"property\": \"plan\", \"values\": [\"pro\"] }]. Entries are combined with AND."
    • removedInput schema / properties / property_filters / items / properties / operator / description
      Removed value: -"Match operator: is, is_not, contains, contains_not (default: is)"
    • removedInput schema / properties / property_filters / items / properties / property / description
      Removed value: -"What to filter on: a built-in dimension (e.g. \"visit:channel\", \"visit:source\", \"event:page\") or a custom event property as its bare name (e.g. \"plan\" targets event:props:plan)"
    • removedInput schema / properties / property_filters / items / properties / values / description
      Removed value: -"One or more values to match the property against"
    • removedInput schema / properties / site_id / description
      Removed value: -"Plausible site domain (e.g. example.com). Required."
    • addedOutput schema / properties / notes
      Added value: +{
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / period_a / properties / metrics / additionalProperties / anyOf
      Added value: +[
      +  {
      +    "type": [
      +      "number",
      +      "null"
      +    ]
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "currency": {
      +        "type": "string"
      +      },
      +      "long": {
      +        "type": "string"
      +      },
      +      "short": {
      +        "type": "string"
      +      },
      +      "value": {
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "value",
      +      "currency",
      +      "short",
      +      "long"
      +    ],
      +    "type": "object"
      +  }
      +]
    • removedOutput schema / properties / period_a / properties / metrics / additionalProperties / type
      Removed value: -[
      -  "number",
      -  "null"
      -]
    • addedOutput schema / properties / period_b / properties / metrics / additionalProperties / anyOf
      Added value: +[
      +  {
      +    "type": [
      +      "number",
      +      "null"
      +    ]
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "currency": {
      +        "type": "string"
      +      },
      +      "long": {
      +        "type": "string"
      +      },
      +      "short": {
      +        "type": "string"
      +      },
      +      "value": {
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "value",
      +      "currency",
      +      "short",
      +      "long"
      +    ],
      +    "type": "object"
      +  }
      +]
    • removedOutput schema / properties / period_b / properties / metrics / additionalProperties / type
      Removed value: -[
      -  "number",
      -  "null"
      -]
  2. Changed3 schema fields changedv0.13.0
    • changedInput schema / properties / period_a / description
      Previous value: -"Baseline (\"before\") date range that deltas are measured from, e.g. \"2024-01-01,2024-01-07\". For a current-vs-prior comparison, this is the prior range."New value: +"Baseline (\"before\") date range that deltas are measured from, e.g. \"2024-01-01,2024-01-07\". Omit it to use the period of the same length right before period_b, as Plausible's \"previous period\" does: period_b \"7d\" alone compares the last 7 days with the 7 days before them. The result gives the dates used."
    • changedInput schema / properties / period_b / description
      Previous value: -"Date range compared against period_a (\"after\"), e.g. \"2024-01-08,2024-01-14\". For a current-vs-prior comparison, this is the current range."New value: +"Date range compared against period_a (\"after\"), e.g. \"2024-01-08,2024-01-14\". For a current-vs-prior comparison, this is the current range; omit period_a to compare it with the period right before it."
    • changedInput schema / required
      Previous value: -[
      -  "site_id",
      -  "period_a",
      -  "period_b"
      -]New value: +[
      +  "site_id",
      +  "period_b"
      +]
  3. Changed1 schema field changedv0.12.2
    • addedInput schema / additionalProperties
      Added value: +false
  4. Changed3 schema fields changedv0.11.3
    • changedInput schema / properties / period_a / description
      Previous value: -"First date range, e.g. \"2024-01-01,2024-01-07\" or \"7d\""New value: +"Baseline (\"before\") date range that deltas are measured from, e.g. \"2024-01-01,2024-01-07\". For a current-vs-prior comparison, this is the prior range."
    • changedInput schema / properties / period_b / description
      Previous value: -"Second date range, e.g. \"2024-01-08,2024-01-14\" or \"7d\""New value: +"Date range compared against period_a (\"after\"), e.g. \"2024-01-08,2024-01-14\". For a current-vs-prior comparison, this is the current range."
    • changedOutput schema / properties / deltas / description
      Previous value: -"Per-metric change from period_a to period_b (absolute and percent)"New value: +"Per-metric change from period_a (baseline) to period_b: absolute is period_b - period_a, percent is that change relative to period_a. A positive value means period_b is higher."
  5. Changed5 schema fields changedv0.10.0
    • changedInput schema / properties / goal / description
      Previous value: -"Filter by goal name (e.g. Signup, Purchase)"New value: +"Filter by goal name (e.g. Signup, Purchase). Do not also target event:goal in property_filters; the call is rejected."
    • changedInput schema / properties / metrics / description
      Previous value: -"Metrics to return. Defaults vary by tool."New value: +"Metrics to return. Defaults vary by tool. Plausible rejects these combinations: bounce_rate or visit_duration with event:goal or event:props:<name> dimensions; pageviews, events, scroll_depth or time_on_page with visit:entry_page or visit:exit_page dimensions; views_per_visit with any non-time dimension or a page filter. For goal conversions use get_conversions."
    • changedInput schema / properties / page / description
      Previous value: -"Filter by page path. Exact match by default, use * as trailing wildcard (e.g. /blog*)"New value: +"Filter by page path. Exact match by default, use * as trailing wildcard (e.g. /blog*). Do not also target event:page in property_filters; the call is rejected."
    • changedInput schema / properties / period_a / pattern
      Previous value: -"^(\\d+h|\\d+d|\\d+mo|day|month|year|all|\\d{4}-\\d{2}-\\d{2},\\d{4}-\\d{2}-\\d{2})$"New value: +"^(\\d+h|\\d+d|\\d+mo|day|month|year|all|\\d{4}-\\d{2}-\\d{2},\\d{4}-\\d{2}-\\d{2}|\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:Z|[+-]\\d{2}:\\d{2}),\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:Z|[+-]\\d{2}:\\d{2}))$"
    • changedInput schema / properties / period_b / pattern
      Previous value: -"^(\\d+h|\\d+d|\\d+mo|day|month|year|all|\\d{4}-\\d{2}-\\d{2},\\d{4}-\\d{2}-\\d{2})$"New value: +"^(\\d+h|\\d+d|\\d+mo|day|month|year|all|\\d{4}-\\d{2}-\\d{2},\\d{4}-\\d{2}-\\d{2}|\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:Z|[+-]\\d{2}:\\d{2}),\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:Z|[+-]\\d{2}:\\d{2}))$"
  6. Changed8 schema fields changedv0.9.0
    • removedOutput schema / properties / deltas / additionalProperties / properties / absolute / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / deltas / additionalProperties / properties / absolute / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / deltas / additionalProperties / properties / percent / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / deltas / additionalProperties / properties / percent / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / period_a / properties / metrics / additionalProperties / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / period_a / properties / metrics / additionalProperties / type
      Added value: +[
      +  "number",
      +  "null"
      +]
    • removedOutput schema / properties / period_b / properties / metrics / additionalProperties / anyOf
      Removed value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedOutput schema / properties / period_b / properties / metrics / additionalProperties / type
      Added value: +[
      +  "number",
      +  "null"
      +]
  7. Changed1 schema field changedv0.7.2
    • addedInput schema / properties / property_filters / items / properties / values / items / maxLength
      Added value: +1024
  8. Changed5 schema fields changedv0.7.1
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / properties / property_filters
      Added value: +{
      +  "description": "Filter results by built-in dimensions or custom event properties, e.g. [{ \"property\": \"visit:channel\", \"operator\": \"is\", \"values\": [\"Organic Search\"] }] or [{ \"property\": \"plan\", \"values\": [\"pro\"] }]. Entries are combined with AND.",
      +  "items": {
      +    "properties": {
      +      "operator": {
      +        "default": "is",
      +        "description": "Match operator: is, is_not, contains, contains_not (default: is)",
      +        "enum": [
      +          "is",
      +          "is_not",
      +          "contains",
      +          "contains_not"
      +        ],
      +        "type": "string"
      +      },
      +      "property": {
      +        "description": "What to filter on: a built-in dimension (e.g. \"visit:channel\", \"visit:source\", \"event:page\") or a custom event property as its bare name (e.g. \"plan\" targets event:props:plan)",
      +        "maxLength": 312,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "values": {
      +        "description": "One or more values to match the property against",
      +        "items": {
      +          "type": "string"
      +        },
      +        "minItems": 1,
      +        "type": "array"
      +      }
      +    },
      +    "required": [
      +      "property",
      +      "values"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / site_id / description
      Previous value: -"Plausible site domain (e.g. example.com). Uses PLAUSIBLE_DEFAULT_SITE_ID if omitted."New value: +"Plausible site domain (e.g. example.com). Required."
    • changedInput schema / required
      Previous value: -[
      -  "period_a",
      -  "period_b"
      -]New value: +[
      +  "site_id",
      +  "period_a",
      +  "period_b"
      +]
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  9. First observedv0.5.1

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent and openWorld, so the safety profile is covered and the bar is lower. The description does add genuine behavioral context beyond them by fixing the sign convention (deltas are period_b minus period_a) and the percent base (relative to period_a), plus the implicit default when period_a is omitted. It says nothing about the response shape, but an output schema exists, so that omission is acceptable.

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?

Three sentences, each earning its place: purpose first, then the sign/base convention an agent would otherwise get wrong, then the practical omit-period_a shortcut. No filler and the most decision-relevant rule is front-loaded.

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

Completeness4/5

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

For a 7-parameter comparative query tool whose output schema already documents results, the description covers what matters most: the relationship between the two periods and the default behavior. It is slightly thin on the filter/metrics parameters, which an agent must read entirely out of the schema.

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 only 29%, so the description carries real weight here, and it does resolve the two genuinely ambiguous parameters: period_a's role as baseline/omittable and period_b's role as the measured period. The remaining parameters (metrics, goal, page, property_filters, site_id) get no treatment at all — notably it never says what happens if metrics is omitted or whether goal/page are filters or paths.

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

Purpose4/5

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

The description opens with a specific verb and resource: 'Compare metrics between two date ranges side by side', which is unambiguous about what the tool produces. It does not, however, contrast itself with close siblings like query_stats or compare_breakdown, so an agent must still infer which of those to pick for a given question.

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?

It gives a concrete use case ('before/after deploy analysis') and a clear rule for the common shorthand case of passing only period_b to get the immediately preceding equal-length period. It stops short of stating when not to use this tool or naming an alternative for single-period or dimension-split queries.

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