Edit one exercise in a workout template
update_workout_template_exerciseChanges- What it does
- Changes or deletes something you had. Your assistant can ask you to confirm first. Safe to retry: the same call twice changes nothing more.
- Permission
- Workouts, change
workouts:write
What your assistant is told
Edit ONE exercise inside a workout template: where it sits in the order (position), which superset it is paired into (groupKey / ungroup), its planned rest (restSeconds), its note, and its planned sets. This is the NARROW way to change a template — every field is optional, and anything you don't pass is left exactly as it is. The other exercises, their planned sets, their notes and their supersets are never touched.
Use this to reorder a plan ("put the squat first"): pass position, and the rest of the template renumbers around it so positions stay 1..n. A number past the end means last. Use it to plan a superset too ("pair the curls with the pushdowns"): call it once per exercise with the same groupKey, a key no other exercise in the template uses — get_workout_template shows the keys in use. update_workout_template is a FULL OVERWRITE and would require you to resend every exercise with its sets — anything you forgot would be deleted. Reach for it only when replacing the whole plan.
Use it to say what a slot is AT ONE PLACE ("at home I do the dumbbell version"): pass atPlace with replaceWith, and that place alone gets that lift — the gym's answer and every other place's are untouched. clearAtPlace takes the pin off again, so the place goes back to the version its equipment asks for. get_program shows each slot's versions and pins; get_my_equipment has the place ids.
It will NOT add an exercise that isn't in the template yet, will NOT remove one, and will NOT change which lift a slot is everywhere (that is update_workout_template; atPlace above changes one place). It edits a PLAN, not a performed workout — for sets the user actually did, use log_set / update_set / update_session_exercise. Idempotent: the same call again changes nothing. Returns the updated template.
Parameters
templateIdid, requiredTemplate UUID returned bylist_workout_templates.exercisetext, requiredThe exercise slot to edit, fromget_workout_template— itsexerciseSlugor itsexerciseId. It must already be in the template.positionwhole number, optionalNew 1-based position in the template — 1 is first. The other exercises renumber around it. A number past the end means last. Omit to leave the order alone.notestext, optionalNew note for this exercise (max 1000 chars), e.g. "tempo 3-1-1". Omit to leave the note alone; pass an empty string to clear it.setslist of object, optionalNew planned sets for this exercise, in order — replaces this exercise's plan and nothing else. Omit to leave the planned sets alone.groupKeywhole number, optionalSuperset key to pair this exercise into: an int shared with the exercise(s) it is alternated with (the app renders a shared key as A1/A2/…). It means nothing beyond "these belong together" and only inside this template. Pair two exercises by calling this tool once for each with the same key. Omit to leave the pairing alone; to break one up passungroup.ungrouptrue or false, optionalTake this exercise out of its superset — it goes back to being performed on its own. Nothing else about it changes, and the exercises it was paired with keep their key. Cannot be combined withgroupKey.restSecondswhole number, optionalPlanned rest between this exercise's sets, in seconds (e.g. 120) — what the app's rest timer counts down after each set. 0 means no rest. Omit to leave it alone; to go back to the app's default rest passclearRestSeconds.clearRestSecondstrue or false, optionalDrop this exercise's planned rest, so the app's default rest applies to it again. Cannot be combined withrestSeconds.atPlacetext, optionalOne of the user's places — itsidfromget_my_equipment, or its name, or "home" / "gym". Names whatreplaceWith/clearAtPlaceapplies to; it changes nothing on its own.replaceWithtext, optionalThe lift this slot is ATatPlace— a catalog slug or an exercise id. Only that place changes. RequiresatPlace.clearAtPlacetrue or false, optionalTake the pin off this slot atatPlace, so it goes back to the lift that place's equipment asks for. RequiresatPlace; cannot be combined withreplaceWith.clientHandletext, optionalOptionalclient_handlefromlist_clientsto run this tool against a coached client's data instead of your own. Omit (or pass null) for your own data — the legacy default.