Sleep stage detail
get_sleep_detailFetch detailed per-night sleep stages with stage-level heart and respiratory rates for one or two specific nights, including partner-shared data when needed.
Instructions
Per-night sleep stages with per-stage HR/RR — depth on a few nights.
Which sleep tool to use:
· THIS one for going deep on one or two specific nights (stage bands,
per-stage vitals). It defaults to 2 nights because each is ~3k
characters; see the SIZE note below.
· get_sleep_nights for anything spanning time — "how did I sleep
this week/month/year", patterns, worst nights. One compact row per
night, a whole year in one read. Reach for it whenever the question
is about a period rather than a night, and do not conclude from THIS
tool's two rows that only two nights exist.
· get_metric with the sleep series (bedtime_minutes,
deep_sleep_minutes, awakenings, ...) for averages computed for you.
(This used to call itself "the primary tool for detailed sleep analysis", which read as "use this one for sleep" and handed back two days to anyone who asked how their week went.)
Returns stage_intervals (contiguous stage bands with start/end),
stage_minutes, and stage_vitals (per-stage HR/RR min/mean/max). Reads
YOUR nights by default; partner=true reads your partner's shared sleep.
limit = the newest N nights, 2 by default. To read a particular night,
pass its date as since and until ("YYYY-MM-DD", the local day the
night ENDS on — the local_date / date column of get_sleep_nights);
a wider since / until reads every night in that window, and limit
then applies only if you pass it.
⚠️ SIZE: each night is ~3k characters as returned (a week ~21k). Setting
include_timeline=True adds the raw per-sample array (hr, rr, stage,
time) — about 13k characters PER NIGHT, which will overflow a typical
25k-token client budget after 2-3 nights. Ask for it only when you need
sample-level vitals (e.g. "when exactly did HR spike"); stage_vitals
already answers per-stage questions. Raise limit for trends, but keep
it low whenever include_timeline=True.
⚠️ is_in_bed_only: true means sleep was NEVER MEASURED that night (the
Watch wasn't worn) — NOT that the person slept zero. duration_label
reads "no sleep data" and in_bed_minutes holds the time actually
recorded in bed. Report it as "no sleep data (in bed ~Xh)", never as
"slept 0 hours".
Carries a coverage block: quote coverage.days_covered (distinct days, not
the row count) and coverage.span_days beside any average or trend.
coverage.window_satisfied: false alone does NOT mean a short history: it is
also false when older days exist beyond your window. 🔴 Before saying how far
back someone's data goes, read coverage.more_available: true means this
server can decrypt days OLDER than first_day that your limit left behind —
re-read with a larger limit, or quote coverage.oldest_available as the real
start of their history. Never report a limit-shaped window as the extent of
their data.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fresh | No | ||
| limit | No | ||
| since | No | ||
| until | No | ||
| partner | No | ||
| include_timeline | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||