Aggregate measurements into a day
aggregate_measurementsRoll up one day's raw measurements into a daily_metrics row, summing activities, averaging vitals, and resolving conflicting sources by priority.
Instructions
Roll up one day's raw measurements into that day's daily_metrics row, so existing analytics tools (which all read daily_metrics) benefit from data logged via log_measurement. Steps/water/workout_minutes sum across the day, resting_heart_rate/mood average, weight_kg takes the latest reading — see logic.MEASUREMENT_AGGREGATION.
If a metric has measurements from more than one source that day (e.g. an Apple Watch and a Garmin both logging resting_heart_rate), use get_metric_provenance first to see whether they actually disagree, then pass source_priority to pick a winner rather than blending two devices' readings into one meaningless average.
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 |
|---|---|---|---|
| date | Yes | The day to aggregate, formatted YYYY-MM-DD. | |
| source_priority | No | Ordered list of source names, e.g. ["Apple Watch", "Garmin"]. For any metric with more than one source that day, the first name in this list that's actually present wins and the other source's readings for that metric are dropped from the aggregate. Omit to fall back to whichever source was imported most recently. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| row | Yes | ||
| date | Yes | ||
| aggregated | Yes |