Icu Get Activity Window Stats
icu_get_activity_window_statsCompute summary statistics for one activity across time windows or blocks—including HR, power, ventilation, and drift—without retrieving raw streams; filter by power to compare efforts.
Instructions
Compute exact SUMMARY statistics of one activity per time WINDOW (every N minutes, N equal parts, or explicit ranges) on the server, without returning raw streams.
Use for drift questions: "how did HR/power and ventilation/power develop over the ride?", "compare 15-min blocks, ignoring everything below 120 W". Prefer this over icu_get_activity_streams for any averaging; use icu_get_activity_intervals for the activity's own laps.
Each window has icu — computed by Intervals.icu on the whole window (avg/NP watts,
HR, decoupling, breath rate, ventilation, tidal volume, DFA a1, plus hr/ve/br per watt)
— and, when
streams or a power filter is given, filtered — mean/median/min/max computed here on
samples passing the filter, plus _per_watt. Filtered mean/median/min/max use 1
decimal for watts, heart rate and similar streams, and 3 decimals for small-range
streams (velocity_smooth, dfa_a1, vertical_ratio, and stream names ending in "ratio").
analysis adds Intervals.icu's whole-ride Pw:HR decoupling and each ratio's drift vs
the first window.
Breath rate comes from Tyme Wear (measured), else the HRV app (custom stream on FIT
field RespirationRate), else the recording device (head unit/watch, device names
it); the last two are HR-derived estimates —
breath_rate_source says which and whether it was measured.
Aliases: VE -> tidal_volume_min, VT -> tidal_volume, BR -> respiration (or the HRV
stream). Missing streams are reported with suggestions.
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": {
"activity_id": "<activity_id>"
},
"name": "icu_get_activity_window_stats"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lag_s | No | In `filtered`, pair power at t with the other streams at t+lag_s (HR lags power ~15-30 s) | |
| parts | No | Split the activity into this many equal parts | |
| streams | No | Extra streams to compute here (mean/median/min/max and per-watt ratio), e.g. ['VE', 'BR', 'TymeVentilation']. Custom names are case-sensitive. | |
| windows | No | Explicit windows as [[start_s, end_s], ...] in elapsed seconds. Give one of block_minutes / parts / windows; none = whole activity. | |
| max_power | No | Drop samples above this power (surges) from `filtered` | |
| min_power | No | Drop samples below this power (coasting/stops) from `filtered` | |
| activity_id | Yes | Activity ID | |
| block_minutes | No | Split the activity into consecutive blocks of this many minutes | |
| power_smoothing_s | No | Apply min/max_power to the trailing N-second mean power instead of raw 1-s power |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |