Compare two periods
compare_metric_periodsCompare a metric’s average across two date ranges—such as this month vs. last month or before vs. after a medication—to identify differences and support before/after analysis.
Instructions
Compare one metric's average between two date ranges — e.g. "this
month vs. last month" or "since starting a new medication vs. before."
The two ranges may be any length and need not be adjacent or equal in
size; each is summarized with its own baseline first. Read
claim.decision/data_health before reporting — must_state has to be
mentioned, and claim.evidence_a/evidence_b can disagree sharply between
the two periods. delta/pct_change are null if either has no data.
Do not use this tool when:
there's only one continuous window and the question is about direction over time, not two discrete ranges -> use
calculate_metric_trendinstead.the user wants "what's normal" for a single window, not a before/after comparison -> use
get_baselineinstead.
Privacy note: this server and its SQLite file are entirely local, but the data returned by this tool becomes part of the conversation sent to whatever model the calling client is configured with. If that model runs in the cloud rather than on your machine, treat this the same as pasting the data into a chat with that provider.
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": {
"metric": "<metric>",
"period_a_start": "<period_a_start>",
"period_a_end": "<period_a_end>",
"period_b_start": "<period_b_start>",
"period_b_end": "<period_b_end>"
},
"name": "compare_metric_periods"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| metric | Yes | One of steps, sleep_hours, resting_heart_rate, weight_kg, workout_minutes, mood, water_ml, heart_rate, hrv_ms. | |
| period_a_end | Yes | ||
| period_b_end | Yes | ||
| period_a_start | Yes | ||
| period_b_start | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| claim | Yes | Evidence and decision for the period comparison claim; read claim.decision before reporting it. | |
| delta | No | ||
| metric | Yes | ||
| period_a | Yes | ||
| period_b | Yes | ||
| pct_change | No | ||
| data_health | No | Whether the data behind this result is complete and current (the weaker of the two periods). | |
| period_a_stats | Yes | ||
| period_b_stats | Yes | ||
| period_a_evidence | Yes | DEPRECATED: identical to claim.evidence_a. Use claim.decision, not a standalone confidence field. | |
| period_b_evidence | Yes | DEPRECATED: identical to claim.evidence_b. Use claim.decision, not a standalone confidence field. |