Calculate metric trend
calculate_metric_trendFit a straight-line trend to one metric across a continuous date window and report its direction, daily slope, and r_squared to distinguish rising, falling, flat, or noisy data.
Instructions
Fit a simple straight-line trend to one metric over a window and
report its direction, slope (change per day), and r_squared (how well
a straight line actually fits — low r_squared means "noisy," not
"flat"; "insufficient_data" below 3 points). A low evidence.coverage_ratio
or claim.decision/data_health means flag the fit as sparse rather
than stating the slope as complete.
Use this tool when the user asks whether one metric is trending up/down/flat over a continuous window.
Do not use this tool when:
the user wants two specific, separately-defined ranges compared, rather than a single continuous slope -> use
compare_metric_periodsinstead.the user asks what's typical/normal rather than direction -> use
get_baselineinstead.the user asks about isolated unusual days rather than overall direction -> use
detect_metric_anomaliesinstead.
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>"
},
"name": "calculate_metric_trend"
}
}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. | |
| end_date | No | Last day to include, YYYY-MM-DD. Defaults to today. | |
| start_date | No | First day to include, YYYY-MM-DD. Defaults to 30 days before end_date. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| claim | Yes | Evidence and decision for the trend claim; read claim.decision before reporting it. | |
| range | Yes | ||
| trend | Yes | ||
| metric | Yes | ||
| evidence | Yes | DEPRECATED: identical to claim.evidence. Use claim.decision, not evidence.confidence. | |
| data_health | No | Whether the data behind this result is complete, current and trustworthy. |