Skip to main content
Glama

Review and keep a program draft

review_program_draft
DestructiveIdempotent

Server-side checklist for a DRAFT training program: it takes the same WorkoutDocument that import_document would take, and verifies day references resolve, every exercise is identifiable, rep ranges make sense, and, in 'coached' mode, that each exercise has a starting weight (or calibration note), matches the user's equipment, does not load an active injury (by the exercise's movement pattern and primary muscles) and respects session length / weekly days.

program_mode='preserve' is for the user's OWN program brought in from a file. The same structural errors are refused, but a missing weight is accepted as a fact about their program, and an equipment or schedule mismatch comes back as a warning rather than a violation. The mode matches the one passed to import_document.

Returns {ok, mode, violations, warnings, unresolved, notes, kept}. unresolved lists fields the file never stated; they are left empty, not inferred.

A draft that passes (ok=true) is kept. On an account with no active program with days, no other program under the draft's program id and nothing listed in unresolved, it is saved as the active program, through the same checks as import_document: kept is {kept_as: 'program', program_id, revision}. Otherwise it is stored as the account's one pending draft, replacing an earlier one, and the active program is not changed: kept is {kept_as: 'pending_draft', saved_at}; the AIm app offers it to the user and get_program returns it as pending_draft. A draft that fails is not kept (kept is null) and an earlier pending draft stays. No profile, intake state, goal or coaching history is created or changed.

Input Schema

NameRequiredDescriptionDefault
documentYes
program_modeNocoached

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / document / properties / body_metrics / items / properties / body_fat_pct / anyOf
      Previous value: -[
      -  {
      -    "maximum": 100,
      -    "minimum": 0,
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "maximum": 75,
      +    "minimum": 2,
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / document / properties / body_metrics / items / properties / body_fat_pct / description
      Previous value: -"Body-fat percentage, 0 to 100."New value: +"Body-fat percentage, 2 to 75."
    • changedInput schema / properties / document / properties / body_metrics / items / properties / bodyweight_kg / anyOf
      Previous value: -[
      -  {
      -    "minimum": 0,
      -    "type": "number"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "maximum": 500,
      +    "minimum": 20,
      +    "type": "number"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedInput schema / properties / document / properties / body_metrics / items / properties / bodyweight_kg / description
      Previous value: -"Body weight in kilograms (1 lb = 0.4536 kg)."New value: +"Body weight in kilograms, 20 to 500 (1 lb = 0.4536 kg)."
  2. Changed1 schema field changed
    • changedInput schema / properties / document / properties / exercises / items / properties / movement_pattern / description
      Previous value: -"The pattern the movement belongs to (squat, hinge, horizontal_push, …). Variations of one lift share a pattern: the load model judges from it whether a muscle is already accustomed to that pattern, and injury checks match on it."New value: +"The pattern the movement belongs to (squat, hinge, horizontal_push, …). Variations of one lift share a pattern: the load model judges from it whether a muscle is already accustomed to that pattern, and the check against movements the user must avoid matches on it."
  3. Changed5 schema fields changed
    • addedInput schema / properties / document / properties / day_templates / items / properties / blocks / items / description
      Added value: +"One unit of a day. A straight block runs each exercise's sets in turn. A superset, circuit\nor giant set runs in rounds: one set of every exercise in order, then the next round\n(A1 → B1 → C1 → A2 …). A superset is the two-exercise case of the same thing."
    • addedInput schema / properties / document / properties / day_templates / items / properties / blocks / items / properties / items / items / properties / rest_sec / description
      Added value: +"Rest in seconds after a set of this exercise. Inside a superset or circuit it is the rest before the next exercise of the same round; 0 means straight on."
    • addedInput schema / properties / document / properties / day_templates / items / properties / blocks / items / properties / rest_after_block_sec / description
      Added value: +"Rest in seconds after a whole round of a superset or circuit, before the next round starts. Distinct from the items' rest_sec, which is the rest inside the round."
    • addedInput schema / properties / document / properties / day_templates / items / properties / blocks / items / properties / rounds / description
      Added value: +"Rounds of a superset or circuit. Each item's target_sets equals it, or is lower when that exercise sits out the later rounds; never higher. Null on a straight block."
    • addedInput schema / properties / document / properties / day_templates / items / properties / blocks / items / properties / type / description
      Added value: +"'straight' (sets of one exercise, then the next), 'superset' (two exercises in rounds), 'circuit' (two or more exercises in rounds), 'giant_set' (as circuit), 'dropset'."
  4. Changed22 schema fields changed
    • changedInput schema / properties / document / properties / body_metrics / items / properties / bodyweight_kg / description
      Previous value: -"Body weight in kilograms. Convert pounds first (1 lb = 0.4536 kg)."New value: +"Body weight in kilograms (1 lb = 0.4536 kg)."
    • changedInput schema / properties / document / properties / body_metrics / items / properties / id / description
      Previous value: -"Leave empty when recording a measurement the user gives you: the entry is then keyed by its date. An id marks an entry copied from a source document (an export, a spreadsheet); import_document manages those, and recording the same id twice fails."New value: +"Absent for a measurement the user states in conversation: that entry is keyed by its date. An id marks an entry copied from a source document (an export, a spreadsheet); import_document manages those, and recording the same id twice fails."
    • changedInput schema / properties / document / properties / exercises / items / properties / category / description
      Previous value: -"What kind of work this is. `cardio` and `mobility` deposit no muscle load at all, so never use them for resistance work — a stretch or a run tagged `compound` lights up the muscle map for days."New value: +"What kind of work this is. `cardio` and `mobility` deposit no muscle load, so they do not describe resistance work; a stretch or a run tagged `compound` shows on the muscle map for days."
    • changedInput schema / properties / document / properties / exercises / items / properties / dose_unit / description
      Previous value: -"What this exercise is dosed in: 'reps' (the usual case), 'seconds' for holds and carries (plank, dead hang, farmer's walk), or 'minutes' for cardio. It says what the rep range and every logged set's number mean — a 60-second plank is not 60 reps."New value: +"What this exercise is dosed in: 'reps' (the usual case), 'seconds' for holds and carries (plank, dead hang, farmer's walk), or 'minutes' for cardio. It is the unit of the planned target; a logged set keeps reps in `reps` and time in `duration_sec` whatever it is, so a 60-second plank is never 60 reps."
    • changedInput schema / properties / document / properties / exercises / items / properties / long_length / description
      Previous value: -"True when the target muscle is loaded in a stretched position (RDL, incline curl, Nordic curl); false when the stretched half is removed (rack pull, hip thrust, cable kickback). Its residual load persists longer in the muscle load model. Leave null only when you genuinely cannot tell from the movement."New value: +"True when the target muscle is loaded in a stretched position (RDL, incline curl, Nordic curl); false when the stretched half is removed (rack pull, hip thrust, cable kickback). Its residual load persists longer in the muscle load model. Null means unclassified, and the model then infers it from the movement pattern."
    • changedInput schema / properties / document / properties / exercises / items / properties / movement_pattern / description
      Previous value: -"The pattern the movement belongs to (squat, hinge, horizontal_push, …). Keep it the same across variations of one lift: it is how the model judges whether a muscle is already accustomed to that pattern."New value: +"The pattern the movement belongs to (squat, hinge, horizontal_push, …). Variations of one lift share a pattern: the load model judges from it whether a muscle is already accustomed to that pattern, and injury checks match on it."
    • changedInput schema / properties / document / properties / exercises / items / properties / pool_slug / description
      Previous value: -"The `slug` of the matching entry from search_exercise_pool, when this exercise comes from the curated pool. Set it whenever a pool entry matches — it keeps one movement under one identity even if the display name is later edited or translated."New value: +"The `slug` of the matching entry from search_exercise_pool, for an exercise that matches a curated pool entry. It keeps one movement under one identity even if the display name is later edited or translated."
    • changedInput schema / properties / document / properties / exercises / items / properties / primary_muscles / description
      Previous value: -"The muscles the exercise is done FOR — the prime movers. These alone are counted against the weekly MEV/MAV set landmarks, so list the target, not everything the movement involves."New value: +"The muscles the exercise is done FOR, the prime movers; assisting and stabilising muscles are the secondary and tertiary lists. Only these count against the weekly MEV/MAV set landmarks."
    • changedInput schema / properties / document / properties / exercises / items / properties / secondary_muscles / description
      Previous value: -"Muscles that assist meaningfully but are not the target (triceps on a bench press). They count in the muscle load model at a reduced weight. Never repeat a primary muscle here."New value: +"Muscles that assist meaningfully but are not the target (triceps on a bench press). They count in the muscle load model at a reduced weight. The list excludes the primary muscles."
    • changedInput schema / properties / document / properties / exercises / items / properties / tertiary_muscles / description
      Previous value: -"Stabilisers and minor assistance (abs on a standing press). They count at a further reduced weight. Never repeat a muscle already listed as primary or secondary; leave empty when unsure."New value: +"Stabilisers and minor assistance (abs on a standing press). They count at a further reduced weight. The list excludes primary and secondary muscles; empty means unspecified."
    • changedInput schema / properties / document / properties / sessions / items / properties / date / description
      Previous value: -"The calendar date the workout happened, in the USER's timezone. Today only when the conversation is plainly about the session they just did. For anything logged after the fact, take the date from what the user said ('last Tuesday') and ask when that is unclear — never derive one from the server's clock. Everything time-based (weekly volume, the muscle load model, the consistency level) is anchored on it."New value: +"The calendar date the workout happened, in the USER's timezone: the day they did it, which for a session logged after the fact ('last Tuesday') is not today, and which the server's UTC clock does not know. Everything time-based (weekly volume, the muscle load model, the consistency level) is anchored on it."
    • changedInput schema / properties / document / properties / sessions / items / properties / entries / items / properties / exercise_id / description
      Previous value: -"Catalog id of the exercise performed. Reuse an id the user already has (`exercise_catalog` in the coaching context, or list_exercises), otherwise a `slug` from search_exercise_pool verbatim. Minting a synonym for a movement that already has an id splits that movement's history in two."New value: +"Catalog id of the exercise performed: an id from the user's catalog (`exercise_catalog` in the coaching context, or list_exercises) or a `slug` from search_exercise_pool, character for character. A new id for a movement that already has one splits that movement's history in two."
    • changedInput schema / properties / document / properties / sessions / items / properties / entries / items / properties / sets / items / properties / distance_m / description
      Previous value: -"Metres covered, for a carry or an interval the user measured that way ('farmer's walk, 30 metres'). Use it instead of duration_sec when what they said was a distance, not a time; fill both only when they gave both."New value: +"Metres covered, for a carry or an interval the user measured that way ('farmer's walk, 30 metres'). Both distance_m and duration_sec are present only when both were measured."
    • changedInput schema / properties / document / properties / sessions / items / properties / entries / items / properties / sets / items / properties / duration_sec / description
      Previous value: -"Seconds under load for a hold or carry (plank, dead hang, farmer's walk), or the duration of a timed interval. Isometric work is dosed in seconds, not reps. Use it when the user gave a time; when they gave a distance instead, use distance_m."New value: +"Seconds under load for a hold or carry (plank, dead hang, farmer's walk), or the duration of a timed interval. Isometric work is dosed in seconds, not reps. A distance-measured carry or interval is distance_m instead."
    • changedInput schema / properties / document / properties / sessions / items / properties / entries / items / properties / sets / items / properties / is_per_side / description
      Previous value: -"True when the set was done one side at a time. Log it as ONE set whose `reps` holds ONE side's count — never doubled, never split into two sets — and set this flag so the number is read the way it was meant. A timed one-sided hold or carry is per-side too: fill duration_sec, leave reps empty. Logging the same exercise both ways stops it comparing to itself."New value: +"True when the set was done one side at a time. Such a set is ONE record whose `reps` (or duration_sec, for a one-sided hold or carry) is ONE side's count, neither doubled nor split into two sets. An exercise recorded both ways does not compare with itself."
    • changedInput schema / properties / document / properties / sessions / items / properties / entries / items / properties / sets / items / properties / reps / description
      Previous value: -"Reps actually completed. On a per-side set give ONE side's count and set is_per_side — never the doubled total, never two sets. Leave empty for a timed hold or carry and use duration_sec instead."New value: +"Reps actually completed. On a per-side set (is_per_side) this is ONE side's count: not the doubled total, and not split into two sets. Empty for a timed hold or carry, whose dose is duration_sec."
    • changedInput schema / properties / document / properties / sessions / items / properties / entries / items / properties / sets / items / properties / rir / description
      Previous value: -"Reps left in the tank at the end of the set; 0 means taken to failure. Fill it only when the user says how close to failure they got ('had two left', 'went to failure'); a bare 'that was hard' or 'felt easy' is not a number — leave it empty rather than guessing one. It is what tells the model the set's load fades slower."New value: +"Reps left in the tank at the end of the set as the user stated it ('had two left', 'went to failure' = 0); a bare 'that was hard' or 'felt easy' states no number, and then the field is empty. It is what tells the model the set's load fades slower."
    • changedInput schema / properties / document / properties / sessions / items / properties / entries / items / properties / sets / items / properties / rpe / description
      Previous value: -"Perceived effort 0-10 — the same question as rir on the other scale (RPE 10 = RIR 0). Use it when the user talks in RPE; rir wins when both are given."New value: +"Perceived effort 0-10 — the same question as rir on the other scale (RPE 10 = RIR 0). It holds a value the user gave in RPE; when both are present, rir takes precedence."
    • changedInput schema / properties / document / properties / sessions / items / properties / entries / items / properties / sets / items / properties / set_id / description
      Previous value: -"The client's own stable id for this set, if it has one. Only the AIm app sends this: it lets a later correction be traced to the set that moved, because set_number is renumbered when a set is removed. Other clients have none and leave it out."New value: +"The client's own stable id for this set, if it has one. Only the AIm app sends this: it lets a later correction be traced to the set that moved, because set_number is renumbered when a set is removed. Absent from other clients."
    • changedInput schema / properties / document / properties / sessions / items / properties / entries / items / properties / sets / items / properties / type / description
      Previous value: -"`working` for real sets. Mark ramp-up sets `warmup`: they are excluded from volume, weekly set counts and the muscle load model, so logging them as working inflates every number the coach reads back. A drop set is not one set: log each weight stage as its own entry in the order performed, the lighter stages `dropset`."New value: +"`working` for real sets, `warmup` for ramp-up sets: warm-ups are excluded from volume, weekly set counts and the muscle load model, and counted as working they inflate every number read back. A drop set is several records, one per weight stage in the order performed, the lighter stages typed `dropset`."
    • changedInput schema / properties / document / properties / sessions / items / properties / entries / items / properties / sets / items / properties / weight_kg / description
      Previous value: -"Load in kilograms: the whole bar for barbell work, ONE dumbbell or kettlebell for dumbbell work. Omit for unloaded bodyweight sets; give only the added weight when the user hangs a plate off a belt."New value: +"Load in kilograms: the whole bar for barbell work, ONE dumbbell or kettlebell for dumbbell work. Absent for unloaded bodyweight sets; for weighted bodyweight work (a plate on a belt) it is the added weight only."
    • changedInput schema / properties / document / properties / sessions / items / properties / start_time / description
      Previous value: -"When the session started, with timezone offset, if the user actually said. Omit it rather than inventing a plausible time."New value: +"When the session started, with timezone offset, as the user stated it; absent when they did not say."
  5. Changed1 schema field changed
    • addedInput schema / properties / document / properties / day_templates / items / properties / blocks / items / properties / items / items / properties / id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null
      +}
  6. Changed1 schema field changed
    • changedInput schema / properties / document / properties / sessions / items / properties / entries / items / properties / sets / items / properties / set_id / description
      Previous value: -"The client's own stable id for this set, if it has one. Only the AIm app sends this: it lets a later correction be traced to the set that moved, because set_number is renumbered when a set is removed. Never invent one — omit it."New value: +"The client's own stable id for this set, if it has one. Only the AIm app sends this: it lets a later correction be traced to the set that moved, because set_number is renumbered when a set is removed. Other clients have none and leave it out."
  7. Changed9 schema fields changed
    • addedInput schema / properties / document / properties / body_metrics / items / properties / athlete_id / description
      Added value: +"Ignored when recording: every entry belongs to the signed-in user."
    • addedInput schema / properties / document / properties / body_metrics / items / properties / body_fat_pct / description
      Added value: +"Body-fat percentage, 0 to 100."
    • addedInput schema / properties / document / properties / body_metrics / items / properties / bodyweight_kg / description
      Added value: +"Body weight in kilograms. Convert pounds first (1 lb = 0.4536 kg)."
    • addedInput schema / properties / document / properties / body_metrics / items / properties / custom_fields / description
      Added value: +"Anything worth keeping that has no field above, such as `resting_hr`. Stored and exported, not displayed."
    • addedInput schema / properties / document / properties / body_metrics / items / properties / date / description
      Added value: +"Day the measurement was taken, YYYY-MM-DD in the user's own calendar. Without an id there is one entry per day: recording the same date again adds to that day's entry, overwriting only the fields and keys you send."
    • addedInput schema / properties / document / properties / body_metrics / items / properties / id / description
      Added value: +"Leave empty when recording a measurement the user gives you: the entry is then keyed by its date. An id marks an entry copied from a source document (an export, a spreadsheet); import_document manages those, and recording the same id twice fails."
    • addedInput schema / properties / document / properties / body_metrics / items / properties / measurements / description
      Added value: +"Circumferences in centimetres, keyed `<site>_cm`. The app shows `chest_cm`, `arm_cm`, `waist_cm` and `thigh_cm`; any other site is stored but not displayed."
    • addedInput schema / properties / document / properties / body_metrics / items / properties / notes / description
      Added value: +"Context the user gave with the number (fasted, evening, after travel)."
    • addedInput schema / properties / document / properties / body_metrics / items / properties / source / description
      Added value: +"Where the number came from, free text: `scale`, `tape`, `dexa`, `smart_scale`"
  8. Changed2 schema fields changed
    • addedInput schema / properties / document / properties / sessions / items / properties / entries / items / properties / sets / items / properties / set_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "maxLength": 128,
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "The client's own stable id for this set, if it has one. Only the AIm app sends this: it lets a later correction be traced to the set that moved, because set_number is renumbered when a set is removed. Never invent one — omit it."
      +}
    • addedInput schema / properties / program_mode
      Added value: +{
      +  "default": "coached",
      +  "enum": [
      +    "coached",
      +    "preserve"
      +  ],
      +  "type": "string"
      +}
  9. First observed

TDQS

A4.6/5.0
Behavior5/5

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

The description goes well beyond annotations by explaining the validation checks, mode-dependent acceptance, kept versus pending-draft outcomes, replacement of an earlier pending draft, non-change to the active program in most cases, and that no profile, intake, goal, or coaching history is modified.

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?

The description is front-loaded with the core purpose and then adds mode, return-shape, and persistence semantics in a logical order. It is dense and appropriately detailed for a complex draft-review tool, though some sentences could be tightened.

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?

Given the complex nested input, destructive/idempotent annotations, and output schema, the description is complete enough for an agent to understand validation behavior, mode differences, return fields, and side effects. No critical behavioral or usage gap remains.

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

Parameters4/5

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

It adds important meaning for program_mode, including coached versus preserve behavior and how mismatches are downgraded to warnings in preserve mode. For document it explains that it is the same WorkoutDocument import_document accepts and what is checked, though it does not independently document the full nested document structure.

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 description states a specific verb and resource: a server-side checklist/review for a DRAFT training program. It identifies the exact validations performed and distinguishes itself from import_document by framing this as review-and-keep rather than import.

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?

It clearly explains the two modes, especially when program_mode='preserve' is intended for the user's own program brought in from a file. It references import_document as the sibling that takes the same document and mode, but does not explicitly spell out a full when-to-use-this-vs-import_document decision rule.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.