Calculate metric trend
calculate_metric_trendFit a linear trend to any personal health metric over a date range, returning direction, daily slope, and r-squared to show how well the line fits.
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").
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.
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, formatted YYYY-MM-DD. Defaults to today. | |
| start_date | No | First day to include, formatted YYYY-MM-DD. Defaults to 30 days before end_date. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| range | Yes | ||
| trend | Yes | ||
| metric | Yes | ||
| evidence | Yes | Coverage/quality of the data a single-metric analytical result is based on. See evidence.build_evidence for how each field is computed. |