Preview a source-priority resolution of a day's measurements
aggregate_measurementsPreview how one day's raw measurements would aggregate under a chosen source priority and compare that preview with the actual stored daily values, without writing data.
Instructions
Preview what one day's raw measurements would roll up to if a conflicting metric were resolved using source_priority, alongside that day's actual current daily_metrics values.
daily_metrics is a database-maintained projection (see db/schema.sql): every log_measurement/import automatically keeps it in sync the moment it's written, using each metric's fixed aggregation method: summed for steps, sleep_hours, workout_minutes and water_ml; averaged for resting_heart_rate, mood, heart_rate and hrv_ms; the latest reading for weight_kg (see aggregation_rules). When a metric has more than one source on a day, the projection uses only one source's observations, never a blend: the highest-ranked present source in the stored priority list (manual log_daily_metric entries rank first by default), else the source with the most hours that day, then the latest observation, then by name. This tool writes nothing: "aggregated" previews what the source_priority you pass would produce; "row" is the real, currently-stored value. If a metric has more than one source that day, use get_metric_provenance first to see whether they actually disagree.
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": {
"date": "<date>"
},
"name": "aggregate_measurements"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | The day to preview, 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 in "aggregated" and the other source's readings for that metric are dropped from that preview. Omit to use the stored priority list and the same fallback the stored projection uses. Never affects "row" — see above. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| row | Yes | ||
| date | Yes | ||
| aggregated | Yes |