create_structured_workout_json
Build and validate Garmin Connect structured workout JSON from coach workout prescriptions, with optional upload to an athlete's calendar or device queue.
Instructions
Validate, build, and optionally upload a structured Garmin Connect workout.
Coaching Purpose:
Translates a coach's workout prescription (warmups, intervals, recovery jogs,
nested repeat blocks, cooldowns with time/distance/lap-button durations and
HR/pace/power/cadence targets) into a schema-validated Garmin Connect
ExecutableStepDTO / RepeatGroupDTO JSON payload. Optionally uploads the
workout directly to the athlete's Garmin Connect calendar/device queue when
upload_to_garmin=True.
Args:
workout_name: Descriptive title for the workout (e.g., "Threshold 4x1km Cruise Intervals").
sport_type: Target sport ("running", "cycling", "swimming", "strength", "cardio").
steps: List of step dictionaries matching WorkoutStepInput (step_type, duration_type,
duration_value, target_type, target_zone_number, target_low, target_high,
description, repeat_steps). If omitted, generates a standard 3-step template.
description: Optional coaching notes or focus cues attached to the workout.
upload_to_garmin: If True, uploads the generated JSON to Garmin Connect via
client.upload_structured_workout(...). Defaults to False.
response_format: Output representation: "markdown", "json", or "hybrid" (default).
Returns:
Formatted workout summary and validated Garmin Connect workout JSON payload
(including uploaded status and uploaded_workout_id when uploaded).
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": {
"workout_name": "<workout_name>"
},
"name": "create_structured_workout_json"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| steps | No | ||
| sport_type | No | running | |
| description | No | ||
| workout_name | Yes | ||
| response_format | No | hybrid | |
| upload_to_garmin | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |