update_workout
UNIT INPUTS: never convert units yourself. For each canonical field below, pass the user's number exactly as stated when it is already in the canonical unit; when they gave the alternate unit instead, pass the same number unconverted and set the matching companion field so the tool converts once before storage. Omit the companion when the number is already canonical. This overrides any wording that asks you to do the arithmetic.
_lb fields: lb, or kg with input_weight_unit set.
_mi fields: mi, or km with input_distance_unit set.
_in fields: in, or cm with input_length_unit set.
_stated_g fields: g, or oz with input_mass_unit set.
_stated_ml fields: ml, or fl_oz with input_volume_unit set.
Update a workout session: correct metadata, fix set values, rename/add/remove exercises or individual sets, or move exercises between supersets. Use for any post-log correction.
FIND THE SESSION: pass session_id if already known. Otherwise pass session_date (YYYY-MM-DD, defaults to today) and, only if more than one session was logged that day, name (a substring of the workout's focus/type, case-insensitive) to narrow it down. A match that isn't exactly one session returns an error explaining why, with nothing changed — retry with session_id or a narrower name, never guess. get_workout still gives full detail (exercise names, slot names SS1/SS2/WarmUp/Finisher) when needed; list_exercises first if adding or renaming. Call with only the fields that change — operations can combine in one call.
OPERATIONS:
Metadata: date, focus_type, location, notes, rpe, heart_points_moderate/peak.
set_updates: patch reps/load/bodyweight/notes/equipment on a set, addressed by set_id OR by exercise_name + set_position (1-based, matches get_workout's "Set N"). Use clear_weight=true when a stored load is wrong but the real external load is unknown; use is_bodyweight=true when the corrected set was genuinely bodyweight.
remove_sets: delete sets, same set_id-or-exercise_name+set_position addressing; remaining sets renumber; an emptied exercise/slot is removed automatically.
rename_exercises: renames every set of an exercise in place (preserves set IDs, RPE, notes; rebuilds NSI), never remove + add.
remove_exercises: deletes all sets for named exercises; empty slots removed automatically.
add_exercises: new exercises with sets; to_superset_slot joins an existing slot, omit for standalone.
move_exercises: reassigns an exercise to a different slot; "new" makes it standalone. Use from_superset_slot from get_workout when the same exercise name appears in multiple slots.
SUPERSET SLOTS: rename_exercises/remove_exercises match by exercise name alone unless scoped. If a name is in more than one slot and the user means only one, pass superset_slot (or { name, superset_slot } for remove_exercises) naming that slot from get_workout. Omitting it hits every occurrence, a real corruption risk.
LITERAL NAME: literal_name: true keeps the user's exact wording instead of the closest library match, skips the resolver, and gets no NSI score (no benchmark to compare an unmatched name against). Use for "call it exactly X", "not the standard one", "literally X", or a rejected match. Applies below.
EQUIPMENT (load basis): dumbbell_pair is one dumbbell in EACH hand, weight_lb PER HAND (2x for NSI); dumbbell_single is one implement total. Laterality (single-leg/arm) does NOT decide this alone. Set it when the user describes the load (each hand, machine, band); a wrong or missing tag silently halves or doubles NSI. Values: barbell, dumbbell_pair, dumbbell_single, machine, kettlebell, bodyweight, band, cable, trx, other.
A set_id or exercise_name+set_position matching more than one set (the same exercise in two superset slots) is ambiguous and errors rather than guessing — use the exact set_id from get_workout to disambiguate.
The result discloses a mismatched name from rename_exercises/add_exercises; relay it in your own words. If a name matches nothing closely enough, the result names near-miss library exercises; ask the user which they meant rather than accept the unscored custom log silently.
INFER — do not ask: session_date defaults to today, set positions count from 1 per exercise. Slot names and set_ids beyond what's inferable come from get_workout; canonical exercise names come from list_exercises.
SAVED WORKOUTS: pass saved_workout_id to edit a reusable Saved Workout instead of completed workout history. Use saved_workout_title, saved_exercise_updates, and/or add_exercises. add_exercises keeps its normal payload shape; to_superset_slot accepts the Saved Workout slot label returned by get_workout or its SS1-style alias. For progression requests, inspect real exercise history first rather than applying a deterministic formula.
WORKOUT CORRECTIONS:
PATCH ONLY: send only fields the user explicitly asked to change. Never restate current date/focus/location/RPE just because you read them; every supplied metadata field overwrites stored data.
Never invent IDs. Use session_id only when a workout tool returned it; otherwise omit it and use session_date + name. session_id must be > 0.
Cardio totals are first-class update fields: distance_mi/distance_km/distance_meters, duration_sec, calories. Never put corrected totals only in notes.
add_sets adds sets to an exercise already in the workout. Use it instead of add_exercises when the exercise already exists.
If the same exercise name appears in multiple superset slots, rename/remove/move without a source slot is rejected instead of touching every occurrence. For a move, pass from_superset_slot from get_workout.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rpe | No | Session RPE, 1-10, half steps allowed: 5 moderate, 7 hard, 9 one rep left, 10 failure. Infer from comments about overall difficulty, or omit. | |
| date | No | New session date, YYYY-MM-DD. | |
| name | No | Substring of the focus/type, e.g. "Push", case-insensitive, to pick between sessions on session_date. Only without session_id. | |
| notes | No | New session notes. | |
| add_sets | No | Add one or more sets to an exercise already present in this workout. Use add_exercises only for a brand-new exercise. | |
| calories | No | Corrected session calories when known. | |
| location | No | New location, e.g. Gym, Home. | |
| focus_type | No | New category, e.g. Push, Pull, Legs. | |
| session_id | No | Positive session ID returned by a workout tool. If unknown, omit and use session_date + name; never guess. | |
| distance_km | No | Corrected session distance in kilometers. Server converts it; do not convert it yourself. | |
| distance_mi | No | Corrected session distance in miles. Use only when the user gave miles. In mi, or km with input_distance_unit set. See UNIT INPUTS. | |
| remove_sets | No | Sets to delete. See OPERATIONS above. | |
| set_updates | No | Individual set corrections. | |
| duration_sec | No | Corrected total session duration in seconds. | |
| session_date | No | YYYY-MM-DD, defaults to today. Finds the session when session_id is omitted. Distinct from `date`, which CHANGES the stored date. | |
| add_exercises | No | New exercises to add. Call list_exercises first for canonical names. | |
| move_exercises | No | Move exercises between superset slots. When the same exercise name appears in multiple slots, from_superset_slot is required. | |
| distance_meters | No | Corrected session distance in meters. Server converts it; do not convert it yourself. | |
| remove_exercises | No | Exercises to remove; matched sets deleted, empty slots removed automatically. See SUPERSET SLOTS above. | |
| rename_exercises | No | Rename logged exercises in place. | |
| saved_workout_id | No | Saved Workout ID to update instead of a completed workout session. | |
| heart_points_peak | No | New peak heart points. | |
| input_distance_unit | No | Set to km when the user gave km for the _mi fields in this object. Omit when they are already mi. | |
| saved_workout_title | No | Optional new title for the Saved Workout. | |
| heart_points_moderate | No | New moderate heart points. | |
| saved_exercise_updates | No | Optional prescription edits matched first by exact Saved Workout exercise name, then by a unique canonical library match. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | Human-readable result text returned by the tool. |