health_trends
Compute period-wise averages and totals from cached health data, optionally comparing two windows. Spot trends in activity, sleep, heart rate, weight, SpO2, HRV, and more.
Instructions
Analyse trends in cached health data.
Computes averages and totals over time from the local cache, auto-syncing if stale.
Args: data_type: What to analyse. Options: "heart_rate", "activity", "exercises", "sleep", "weight", "spo2", "hrv", "azm", "breathing_rate", "skin_temperature", "core_temperature", "cardio_fitness", "food_log". Default: "activity". period: Aggregation period. Options: "weekly", "monthly", "quarterly". Default: "monthly". start_date: Start date as "YYYY-MM-DD" or "365d". Default: last 12 months. end_date: End date as "YYYY-MM-DD". Default: today. compare: Compare two periods. Format: "last_30d vs previous_30d", "2026-03 vs 2026-02", "2026-Q1 vs 2025-Q4". When set, period/start_date/end_date are ignored.
Returns aggregated averages per period. For activity: steps, distance, active minutes. For exercises: sessions, duration, calories. For sleep: duration, efficiency, stage breakdown. For heart_rate: resting HR min/avg/max. For weight: weight, fat%, BMI. For hrv: daily and deep RMSSD.
Two data types report their history under two definitions, each with the count of readings behind it - never merge them into one series. For spo2, min_spo2/max_spo2 are observed nightly extremes, while avg_nightly_ci_low/avg_nightly_ci_high average the nightly bounds of a confidence interval on each night's own average. For cardio_fitness, avg_vo2_max_low/high average a reported band while avg_vo2_max averages a single value.
Those per-definition fields and their counts appear in the period form
only. compare= reports spo2 as avg_spo2 alone, which is deliberate and
not a gap: that column means the same thing under both definitions, so it
is the one figure two windows either side of the switchover can be
compared on. Ask for the period form when you need to know which
definition is behind a number. cardio_fitness has no such neutral column,
so compare= carries both definitions there.
Not for raw data - use health_get_* tools instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| period | No | monthly | |
| compare | No | ||
| end_date | No | ||
| data_type | No | activity | |
| start_date | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |