query_workout_series
Retrieve a cached, auto-downsampled heart-rate curve and summary statistics for one workout_id from query_workouts.
Instructions
Read an auto-downsampled heart-rate curve for one workout_id obtained from query_workouts (contract agent-safe-series/v1). Uses all cached heart-rate sample types inside the workout window. Returns data with numeric t offsets in seconds from start_time, bpm values, downsampled/source_points/returned_points/method and full-resolution summary statistics. resolution defaults to 60 seconds and increases to respect max_points (default 400, hard cap 500). Pass the same reference_max_hr in bpm for comparable time_in_zone across activities; otherwise each workout uses its own maximum, so zones are not comparable. Unknown workout IDs or unsupported metrics return status=error. For raw date-range samples use query_heart_rate. Read-only local SQLite query; no cloud request or automatic sync. Requires a configured local account/cache. Returns JSON text with status, source=cache, generated_at and data; empty lists mean no cached matches, not zero measurements. Use get_data_coverage to inspect availability or sync_data to refresh with user consent.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| metric | No | Only heart_rate is supported; values are beats per minute (bpm). | heart_rate |
| max_points | No | Requested maximum returned points (default 400, 1..500); server also clamps direct service calls to this range. | |
| resolution | No | Requested bucket duration in seconds (default 60, at least 1); automatically increased to fit max_points. | |
| workout_id | Yes | Exact workout_id returned by query_workouts for this account; do not invent an ID. | |
| reference_max_hr | No | Optional positive reference maximum heart rate in bpm for zone normalization; use the same value across compared workouts. Omit to use this workout maximum. |