health_get_sleep
Retrieve nightly sleep data including duration, stages, and efficiency. Specify a date range to analyze sleep patterns or fetch the latest API data for updated records.
Instructions
Get nightly sleep data (duration, stages, efficiency).
Returns sleep data from the local cache by default. Use live=True to fetch from the API. Run health_sync first to populate the cache.
Sleep data is sparse: only nights with watch-tracked sleep are present. Travel, off-wrist nights, or manual logs may be missing.
Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "30d". Default: last 30 days. end_date: End date as "YYYY-MM-DD". Default: today. live: If true, re-fetch this window from the API before reading the cache.
Returns one entry per night with total_minutes, efficiency, start/end times, and stage breakdown (deep, light, REM, wake minutes).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| live | No | ||
| end_date | No | ||
| start_date | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |