get_health_metrics
Retrieve Apple Health metric values for any date range with avg, sum, min, max, or latest aggregation, plus data coverage details.
Instructions
Get values for a metric (or all metrics) over an optional date range, with an aggregate (avg/sum/min/max/latest). The core data-retrieval tool. Every result carries a coverage block giving the metric's real firstDate/lastDate/days: check it before trusting a long window, and note that aggregate is always computed over the full range even when points are rolled up. Single-metric answers also list any logged point events inside the window as segmentBoundaries.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | YYYY-MM-DD | |
| limit | No | Maximum data points to return (default 365, max 3000). The server rolls up rather than truncating. | |
| start | No | YYYY-MM-DD | |
| metric | No | Metric name, e.g. step_count, heart_rate, sleep_analysis. Omit for all. | |
| filterDays | No | Restrict to days covered by matching logged events (health-events.json): endDate ranges cover every day inclusive, point events cover their single day, negate:true keeps only days NOT covered. The answer states how many days matched. Example: HRV on night-shift blocks vs days off. | |
| aggregation | No | ||
| granularity | No | Roll daily values up before returning them. 'auto' (default) picks the finest granularity that fits the response budget, so a multi-year range returns monthly points instead of thousands of daily ones. |