Skip to main content
Glama

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

NameRequiredDescriptionDefault
stepsNo
sport_typeNorunning
descriptionNo
workout_nameYes
response_formatNohybrid
upload_to_garminNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations at all, the description carries the full burden and does well: it discloses that output is schema-validated, that a standard 3-step template is generated when 'steps' is omitted, that upload is an opt-in side effect defaulting to False, and that the response reports 'uploaded' status and 'uploaded_workout_id'. It omits meaningful write-path context an agent would want — authentication requirements, what happens on validation failure, and whether repeated calls create duplicate workouts on the calendar.

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?

It is well structured and front-loaded: the action triple leads, followed by scoped Purpose, Args, and Returns sections that map cleanly onto the schema. The 'Coaching Purpose' paragraph is somewhat expansive and partially restates what the Args section covers, but for a tool with nested step structures the length is largely earned.

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

Completeness4/5

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

For a 6-parameter creation tool with nested step dictionaries and an output schema, the definition supplies everything needed to build a call: field semantics, defaults, enums, and the optional upload consequence. The remaining gap is operational rather than structural — nothing is said about Garmin Connect authentication prerequisites or failure modes for the upload path.

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 description coverage is 0%, so the description must fully compensate, and it does: all six parameters are documented, including enum values for 'sport_type' and 'response_format', the default of 'hybrid' and False respectively, the null-template behavior for 'steps', and even the nested keys of each step dict (step_type, duration_type, duration_value, target_type, target_zone_number, target_low, target_high, description, repeat_steps). This adds substantially more meaning than the bare schema titles.

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?

The opening sentence gives three specific verbs (validate, build, optionally upload) against a specific resource (structured Garmin Connect workout), and the 'Coaching Purpose' paragraph makes the input-to-output transformation explicit (coach's prescription -> ExecutableStepDTO/RepeatGroupDTO payload). Every sibling tool listed is a read/get tool, so the create-and-upload role is unambiguous.

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

Usage Guidelines4/5

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

The description clearly establishes the context of use (converting a workout prescription into Garmin JSON) and states the condition that triggers the write path: 'Optionally uploads ... when upload_to_garmin=True', with the non-upload default made explicit. It does not state when NOT to use it, nor mention preconditions such as an authenticated Garmin Connect session, so it falls short of explicit when/when-not/alternatives guidance.

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