Skip to main content
Glama

Compara dos periodos arbitrarios

compare_periods
Read-onlyIdempotent

Compara dos periodos arbitrarios. KPIs de dos rangos A/B con su variación; con dimension, además el top N de esa dimensión con la variación entre A y B. A es el periodo que se mide y B la referencia: change = (A − B) / B, así que para «esta semana frente a la anterior» A es esta semana y B la anterior.

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>",
      "a_from": "<a_from>",
      "a_to": "<a_to>",
      "b_from": "<b_from>",
      "b_to": "<b_to>"
    },
    "name": "compare_periods"
  }
}

Input Schema

NameRequiredDescriptionDefault
a_toYesÚltimo día del periodo A (el que se mide).
b_toYesÚltimo día del periodo B (la referencia).
limitNoMáximo de filas del desglose.
a_fromYesPrimer día del periodo A (el que se mide).
b_fromYesPrimer día del periodo B (la referencia).
site_idYesId de la web (campo `id` de `/v1/sites`).
dimensionNoDimensión a desglosar (opcional).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so safety is covered. The description adds genuinely new behavioral context: the variation formula `change = (A − B) / B` and the directional semantics of A vs B, which an agent cannot infer from the annotations. Return shape and pagination limits are not described.

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

Conciseness4/5

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

Three sentences, front-loaded with the purpose, then the dimension variant, then the A/B semantics. Dense but every sentence carries information; no filler.

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?

With no output schema, the description does state what comes back (KPIs of both ranges with variation, plus optional top-N breakdown). It does not enumerate which KPIs are included or the shape of the breakdown rows, a minor gap for a 7-parameter comparison tool.

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 coverage is 100%, so the baseline is 3. The description reinforces the A/B roles and explains what `change` means, but the schema already labels a_from/a_to as 'el que se mide' and b_from/b_to as 'la referencia', so the added meaning is modest.

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 uses a specific verb and resource ('Compara dos periodos arbitrarios', 'KPIs de dos rangos A/B con su variación') and clarifies that adding `dimension` also returns a top-N breakdown. It is clearly distinguishable from the single-period stats tools, though it never names a sibling explicitly.

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 concrete guidance on how to assign the two periods, including a worked example ('esta semana frente a la anterior' → A is this week, B the previous). It does not state when to prefer this over get_stats_overview or get_stats_breakdown, so exclusions are absent.

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