Skip to main content
Glama
Intervals.icu MCP Server
by arjohns

Icu Get Activity Window Stats

icu_get_activity_window_stats
Read-onlyIdempotent

Compute 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

NameRequiredDescriptionDefault
lag_sNoIn `filtered`, pair power at t with the other streams at t+lag_s (HR lags power ~15-30 s)
partsNoSplit the activity into this many equal parts
streamsNoExtra streams to compute here (mean/median/min/max and per-watt ratio), e.g. ['VE', 'BR', 'TymeVentilation']. Custom names are case-sensitive.
windowsNoExplicit windows as [[start_s, end_s], ...] in elapsed seconds. Give one of block_minutes / parts / windows; none = whole activity.
max_powerNoDrop samples above this power (surges) from `filtered`
min_powerNoDrop samples below this power (coasting/stops) from `filtered`
activity_idYesActivity ID
block_minutesNoSplit the activity into consecutive blocks of this many minutes
power_smoothing_sNoApply min/max_power to the trailing N-second mean power instead of raw 1-s power

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover safety (readOnly, idempotent, non-destructive), yet the description adds substantial behavioral detail: the `icu` block is computed by Intervals.icu on the whole window, `filtered` only appears when streams or a power filter is given, rounding is 1 decimal for watts/HR and 3 for small-range streams, and `analysis` adds whole-ride Pw:HR decoupling plus per-ratio drift. It also discloses breath-rate provenance and fallback chain (Tyme Wear → HRV app → device estimate) and that missing streams return suggestions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core statement and then clearly separated into usage, output-shape, rounding, breath-rate provenance, and alias paragraphs. Dense but nearly every sentence carries operational information; the decimal-precision rules are granular enough to feel borderline, though they do affect interpretation of results.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 9-parameter analytical tool with an output schema, the description covers everything an agent needs: windowing modes, filter semantics, the two result blocks, provenance of derived values, and the sibling routing. No important invocation decision is left to inference.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so the baseline would be 3, but the description adds real meaning: alias resolution (VE -> tidal_volume_min, VT -> tidal_volume, BR -> respiration or the HRV stream), the distinction between filtered vs unfiltered computation, and the interaction between `streams`/power filters. The lag semantics are clarified in the schema itself and corroborated by the description's averaging framing.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Compute exact SUMMARY statistics of one activity per time WINDOW') and enumerates the three windowing modes (every N minutes, N equal parts, explicit ranges), plus a server-side/no-raw-stream note. It is immediately distinguishable from icu_get_activity_streams and icu_get_activity_intervals.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete example questions it serves ('how did HR/power and ventilation/power develop over the ride?') and explicit routing rules: prefer this over icu_get_activity_streams for averaging, use icu_get_activity_intervals for the activity's own laps. Both when-to-use and when-not are present.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools