validate_workout
Check a drafted workout before writing: verify step durations, distances, targets, repeats, ramps, warm-up/cooldown, step sum, and same-day duplicate names. Read-only; review results before saving.
Instructions
Use before every workout write (add_or_update_event, add_events_bulk, create_library_workout) to check a drafted workout document; read-only, nothing is written.
Checks durations or distances per step, repeat blocks, target units per sport and plausible values, ramps and ranges, warm-up and cool-down, the step sum against moving_time and the sport; with start_date it lists the events already on that day and flags a same-name event as a possible duplicate. Format: intervals://workout-syntax (get_guide). Show the result to the athlete before writing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Planned event name, for the duplicate check | |
| athlete_id | No | Default: the configured athlete | |
| start_date | No | Planned day YYYY-MM-DD, for the calendar check | |
| moving_time | No | Expected moving time in seconds, compared with the step sum | |
| workout_doc | Yes | Workout document with steps, as for add_or_update_event. Format: intervals://workout-syntax | |
| workout_type | Yes | Sport of the workout, e.g. Ride, GravelRide, Run, Swim | |
| output_format | No | json = machine-readable, all fields | text |
| check_calendar | No | Look up the events already on start_date |