Log workout
log_workoutSave strength sets (done or being done) with their exercises. One gym visit = one session: use the SAME name for the whole visit; calling again with the same date + name (or with session_id) appends the new sets (send only the new ones). Weights for two-dumbbell lifts are PER HAND. OPEN WORKOUT: when the user started the workout in the Heza app (get_current_context shows it), pass its session_id and log each set as it is done: the planned sets on their screen fill in as you log. Without session_id or a matching name, today's single open workout is used. Unilateral exercises (split squats, single-leg calf raises, side planks, dead bugs, one-arm rows): pass side='each' when the reps/time are per side, 'left'/'right' for one side. PERCEIVED EFFORT: include per-set rpe (1-10) or rir (reps in reserve) whenever the user says how hard it felt. If they didn't, after logging ask ONE short optional question ('How hard did that feel, RPE or reps left?') and save the answer with update_workout_set; never insist, and don't ask again in the conversation if they skip. Logged today without times, sets are stamped with the current time, so the session spans first to last logged set. When the workout is over, call finish_workout_session (pass the real start and end times when the user gave them: the calorie estimate uses them). Pass exercise names as the user says them (or exercise_id when you have it): each is matched to the library and the user's own exercises, and the result shows what it matched. All exercises are resolved before anything is saved; a name without a confident match saves nothing and returns the closest ones. Look names up with list_exercises only to choose between variations or after a failed match. A matching planned workout that day is marked done and linked (pass planned_workout_id when the user did a planned day: the result then compares planned vs done). To fix logged sets use get_workout_session, then update_workout_set / move_workout_sets / delete_workout_sets.
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": {
"exercises": "<exercises>"
},
"name": "log_workout"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rpe | No | Overall session RPE | |
| date | No | YYYY-MM-DD, defaults to today | |
| name | No | Session name, e.g. 'Upper A' or 'Push day' (required unless session_id is given or a workout is open in the app today) | |
| notes | No | ||
| calories | No | ||
| template | No | Template name or id this session followed | |
| exercises | Yes | ||
| session_id | No | Append to this existing session (id from get_workout_history / get_workout_session) | |
| started_at | No | HH:MM local or ISO datetime | |
| duration_min | No | ||
| planned_workout_id | No | The planned day this workout carried out (id from get_week_plan) | |
| create_missing_exercises | No | Create custom exercises for names with no match (default false) |