Skip to main content
Glama
PhilipAD

MetricBridge (formerly Health Export AI)

compare_periods

Read-onlyIdempotent

Compare a health metric between two date periods or around a logged event, returning each aggregate plus absolute and percent change for before/after analysis.

Instructions

Compare a metric between two arbitrary date periods (A vs B): each aggregate plus the change and percent change. Pass periodA/periodB explicitly, or pass anchor {eventId, days} to build both periods around a logged event (the before/after question, with the event day excluded from both sides).

Input Schema

NameRequiredDescriptionDefault
anchorNoBuild both periods around a logged event instead of passing dates: periodA is the {days} days before the event date, periodB the {days} days after, the event day itself excluded from both. Get event ids from list_events (app and agent-logged events both work). Pass either anchor or periodA/periodB, not both.
metricYes
periodANo
periodBNo
excludeTravelDaysNoDrop days on which a timezone change landed (health-days.json): those days were not 24 hours long, so their totals are stretched or shortened by the clock. The answer reports how many days were excluded and why.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.8.0
    • changedInput schema / properties / anchor / description
      Previous value: -"Build both periods around a logged event instead of passing dates: periodA is the {days} days before the event date, periodB the {days} days after, the event day itself excluded from both. Get event ids from list_events. Pass either anchor or periodA/periodB, not both."New value: +"Build both periods around a logged event instead of passing dates: periodA is the {days} days before the event date, periodB the {days} days after, the event day itself excluded from both. Get event ids from list_events (app and agent-logged events both work). Pass either anchor or periodA/periodB, not both."
  2. Changed3 schema fields changedv1.4.0
    • addedInput schema / properties / anchor
      Added value: +{
      +  "description": "Build both periods around a logged event instead of passing dates: periodA is the {days} days before the event date, periodB the {days} days after, the event day itself excluded from both. Get event ids from list_events. Pass either anchor or periodA/periodB, not both.",
      +  "properties": {
      +    "days": {
      +      "description": "Days on each side of the event.",
      +      "type": "integer"
      +    },
      +    "eventId": {
      +      "description": "Event id from list_events.",
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
    • addedInput schema / properties / excludeTravelDays
      Added value: +{
      +  "description": "Drop days on which a timezone change landed (health-days.json): those days were not 24 hours long, so their totals are stretched or shortened by the clock. The answer reports how many days were excluded and why.",
      +  "type": "boolean"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "metric",
      -  "periodA",
      -  "periodB"
      -]New value: +[
      +  "metric"
      +]
  3. First observedv1.0.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover safety (readOnlyHint, idempotentHint, openWorldHint=false), so the description's job is to add context — and it does: the event day is excluded from both sides, and the answer contains aggregate, change, and percent change. It stops short of noting how missing data or partial periods are handled.

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?

Two dense sentences that front-load the core comparison and then the anchor shortcut; nearly every clause earns its place. The nested parentheticals make it slightly harder to scan than a truly crisp definition.

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

Completeness3/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 helpfully sketches the return values, and the anchor semantics are covered. The gap is the required metric argument: an agent still doesn't know what strings are legal or whether it must call resolve_metric first.

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 only 40%, so the description must compensate. It explains the anchor-vs-periodA/periodB tradeoff and the event-day exclusion well, but the required 'metric' parameter is documented nowhere — no valid values or pointer to list_metrics/resolve_metric — and excludeTravelDays is left entirely to the schema.

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 names a specific verb and resource — 'Compare a metric between two arbitrary date periods (A vs B)' — and even states the shape of the answer (each aggregate plus the change and percent change). It does not name a sibling such as get_trends or correlate_metrics to sharpen the boundary, which keeps it below a 5.

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 two clear invocation modes: pass periodA/periodB explicitly, or pass anchor {eventId, days} for the 'before/after question'. That is real usage guidance, but it offers no exclusions or comparison against alternatives like get_trends or correlate_metrics.

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