TrainRec
v1.0.0Your AI assistant logs your meals and workouts, then plans your week from what you did.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
trainrec_overview Overview
Today's date and weight unit for this person, today's food against their targets, their last few workouts, their routines, notes they left, and what they changed in the app since the assistant's last change (sets done differently from a plan show the planned values beside them). Each planned workout says whether it is reviewed: the app shows "Reviewed by" if the assistant wrote the plan after the person's latest workout. suggestedNext is the app's own pick from their rotation when nothing is planned today. Read-only.
trainrec_list_workouts List workouts
Workouts between two dates, newest first, with each exercise and how many of its sets were done. Sets themselves are not included.
| Parameter | Type | Description |
|---|---|---|
from | string | YYYY-MM-DD, inclusive. |
limit | integer | Default 20, at most 100. |
to | string | YYYY-MM-DD, inclusive. |
trainrec_get_workout Get a workout
One workout with every set, in the person's unit, and its version.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
unit | string | Unit for every weight in this call. Defaults to the person's own unit. |
trainrec_exercise_history Exercise history
One exercise over time: personal records (heaviest, best estimated one-rep max, most reps, best session volume) and every session that included it, oldest first. Warm-ups and sets not done are excluded. pace is a straight line through the last 12 weeks of session estimated one-rep maxes (from weights and reps only), with where that line is in 4, 8 and 12 weeks; with target, also the day the line reaches it. pace is a projection at the current rate.
| Parameter | Type | Description |
|---|---|---|
exerciseId * | string | |
limit | integer | Most recent sessions to return. Default 10. |
target | number | A one-rep max to reach, in unit. |
unit | string | Unit for every weight in this call. Defaults to the person's own unit. |
trainrec_list_exercises List exercises
Exercise ids, names and kinds, built-in and custom, optionally filtered by words in the name. The kind decides which set fields apply.
| Parameter | Type | Description |
|---|---|---|
query | string |
trainrec_food_day Food for a day
Everything eaten on one day, each entry with its id and version, totals by meal and for the day, and what is left of the targets.
| Parameter | Type | Description |
|---|---|---|
day | string | YYYY-MM-DD. Default today. |
trainrec_recent_changes Recent changes
The latest changes to this log, newest first, with who made each one and its seq number.
| Parameter | Type | Description |
|---|---|---|
limit | integer | Default 20. |
trainrec_plan_workout Plan a workout to follow
Plans a workout for the person to do: saves it in TrainRec, where their phone and watch walk them through it one set at a time, with each set's target (weight and reps, time or distance) and the rest after it. Every set starts as not yet done. Given an id and version, it changes an existing plan, even during the workout: sets already done are kept, and the phone and watch show the change within seconds. A workout that already happened is recorded with save_workout.
| Parameter | Type | Description |
|---|---|---|
exercises * | array | In the order performed, by exercise id (built-in or custom). |
name * | string | e.g. "Easy 5K and core", "Upper body A". |
day | string | YYYY-MM-DD. Default today. |
fresh | boolean | true puts a workout started by mistake back to a plan: no set done, no start time. Send the whole plan. |
id | string | Omit to create. |
notes | string | Shown at the top while they follow it: the goal of the session, cues. |
summary | string | |
unit | string | Unit for every weight in this call. Defaults to the person's own unit. |
version | integer | Required when id is given. |
trainrec_save_workout Save a workout
Logs a new workout, or replaces an existing one given its id and version: the whole workout as it should now be, so anything left out is removed. Sets default to done; planned sets for a later day have done: false. The change shows in the person's app with Undo.
| Parameter | Type | Description |
|---|---|---|
exercises * | array | In the order performed, by exercise id (built-in or custom). |
name * | string | e.g. "Push Day". |
day | string | YYYY-MM-DD. Default today. |
finishedAt | string | When it ended, ISO with offset. Marks a logged workout finished. |
id | string | Omit to create. |
notes | string | |
reopen | boolean | true takes the finish off a workout ended by mistake, so it is under way again. |
startedAt | string | When it started, ISO with offset, if the person said ("this morning at 7"). Kept when editing. |
summary | string | One short line for the change list, e.g. "Logged Push Day". |
unit | string | Unit for every weight in this call. Defaults to the person's own unit. |
version | integer | Required when id is given. |
trainrec_delete_workout Delete a workout
Removes one workout, given its id and version. The person can undo it in the app.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
version * | integer | |
summary | string |
trainrec_log_food Log food
Adds one or more food entries, each with its numbers PER SERVING and the number of servings. perServing takes the macros and any label nutrient (sodiumMg, potassiumMg and the rest); a nutrient left out counts as unknown, not zero. A glass of plain water is an entry named "Water" with kcal and macros 0 and waterMl. Each entry is its own change, with Undo. When the person asks to note a food without numbers ("just note it"), leave perServing out: it shows as numbers not added yet, until edit_food gives it perServing. planned: true puts a meal on a day ahead (or later today) without counting it i…
| Parameter | Type | Description |
|---|---|---|
entries * | array | |
summary | string |
trainrec_edit_food Edit a food entry
Changes fields of one food entry, given its id and version. Fields left out stay as they are; perServing is replaced whole. planned: false marks a planned food eaten, with servings or perServing in the same call as what was actually had.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
version * | integer | |
day | string | |
meal | string | |
name | string | |
perServing | object | For ONE serving, as the label or a reliable source states it. |
planned | boolean | false: eaten. true: planned, not eaten yet. |
servingLabel | string | |
servings | number | |
summary | string |
trainrec_delete_food Delete a food entry
Removes one food entry, given its id and version. The person can undo it in the app.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
version * | integer |
trainrec_set_targets Set daily targets
Sets the daily calorie and macro targets, and optionally a target for any other nutrient (the keys in overview.foodNutrients): a ceiling for the ones to limit, such as sodiumMg, cholesterolMg, sugarG, saturatedFatG or caffeineMg, and an amount to reach for the rest, such as potassiumMg, fiberG or calciumMg. nutrients left out keeps the ones already set; {} clears them.
| Parameter | Type | Description |
|---|---|---|
carbsG * | number | |
fatG * | number | |
kcal * | number | |
proteinG * | number | |
nutrients | object |
trainrec_settings Settings
The person's settings: weight unit, which nutrients beyond the macros show on their Food and Today screens, how much of a day's workout calories is added to their calorie target, their weight goal, and what the sled or bar of a plate-loaded or Smith machine weighs empty (baseWeights; a set's weight is the total, so plates loaded = weight - base). Also lists what only the person can change on the phone. Read-only.
trainrec_change_settings Change settings
Changes settings. unit: lb or kg. foodShows: the full list of extra nutrients shown, in order, replacing the old one ([] shows only the macros). exerciseCalories: none, half or all of each day's bonus calories (active calories beyond a usual day, or workout calories when there is no daily count) added to the calorie target. weightGoal: a body weight in goalUnit (or theirs), or 0 to clear it; progress counts from their current trend. baseWeight: what a plate-loaded or Smith machine's sled or bar weighs empty, for one exercise (0 when not counted), or a barbell exercise's bar when it is not the…
| Parameter | Type | Description |
|---|---|---|
baseWeight | object | |
birthYear | integer | The year they were born. |
exerciseCalories | string | |
foodShows | array | |
goalUnit | string | Unit of weightGoal. Defaults to the person's. |
unit | string | |
weightGoal | number | Weight to reach, in goalUnit. 0 clears the goal. |
trainrec_save_routine Save a routine
Creates a routine (a reusable workout plan the person starts from the app), or replaces one given its id and version. Same shape as a workout, without a day. The app calls routines templates. folder puts it in a folder of that name on their Templates page; left out, an edited routine stays where it was.
| Parameter | Type | Description |
|---|---|---|
exercises * | array | In the order performed, by exercise id (built-in or custom). |
name * | string | |
folder | string | |
id | string | |
notes | string | |
summary | string | |
unit | string | Unit for every weight in this call. Defaults to the person's own unit. |
version | integer |
trainrec_get_routine Get a routine
One routine with every set, in the person's unit, and its version.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
unit | string | Unit for every weight in this call. Defaults to the person's own unit. |
trainrec_delete_routine Delete a routine
Removes one routine, given its id and version. Workouts already done from it stay. The person can undo it in the app.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
version * | integer |
trainrec_add_exercise Add a custom exercise
Makes a custom exercise with a name, kind and muscles. equipment: "plate" for a plate-loaded machine or "smith" for a Smith machine gives it a sled or bar its base weight is counted from (change_settings baseWeight).
| Parameter | Type | Description |
|---|---|---|
kind * | string | |
name * | string | |
equipment | string | |
muscles | array |
trainrec_undo_change Undo a change
Puts a record back the way it was before one change, given the change's seq. Refused if the record has been changed again since.
| Parameter | Type | Description |
|---|---|---|
seq * | integer |
trainrec_measurements Body measurements over time
Body measurements over time, one kind at a time, one value per day (the last reading of the day), in the person's units, newest last: weight, body fat, tape measurements, calories eaten per day, resting heart rate, HRV, blood pressure and sleep, and from Oura readiness, sleep score, temperature change and minutes stressed and restored. Without kind, the latest reading of every kind recorded. Each value has its id and version.
| Parameter | Type | Description |
|---|---|---|
from | string | YYYY-MM-DD. |
kind | string | |
limit | integer | Most recent days to return. Default 60, at most 400. |
to | string | YYYY-MM-DD. |
trainrec_log_measurement Log a measurement
Records one measurement: weight, body fat, a tape measurement, blood pressure, resting heart rate, HRV or sleep, in the unit given (lb, kg, %, in, cm, bpm, ms, mmHg, min). Blood pressure takes systolic as value and diastolic as value2.
| Parameter | Type | Description |
|---|---|---|
kind * | string | |
value * | number | |
at | string | When it was taken, ISO or YYYY-MM-DD HH:MM. Default now. |
unit | string | |
value2 | number |
trainrec_delete_measurement Delete a measurement
Removes one reading, given its id and version. The person can undo it in the app.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
version * | integer |
trainrec_import_measurements Import measurement history
Imports past measurements (weight, body fat, tape, blood pressure, resting heart rate, HRV, sleep, daily calories), each with its time as the source wrote it, kind, value and unit, and origin when the source names one. Up to 1000 per call; the same batch id on later calls makes one import. Readings already recorded are skipped.
| Parameter | Type | Description |
|---|---|---|
app * | string | |
items * | array | |
batch | string |
trainrec_import_file Import a Strong or Hevy export
Imports a CSV exported from Strong (workouts or measurements) or Hevy, as text exactly as the file has it; the server parses it. A large file can be sent in pieces split on whole workouts, each with the header line and the same batch id. Strong exports omit their unit. Workouts already imported are skipped. Only Strong and Hevy formats.
| Parameter | Type | Description |
|---|---|---|
text * | string | The CSV text, header line first. |
batch | string | Returned by the first call; pass it on later pieces of the same file. |
format | string | Detected from the header when omitted. |
unit | string | Unit for every weight in this call. Defaults to the person's own unit. |
trainrec_import_workouts Import workouts from another app
Imports past workouts from another app or file. Exercises are matched to existing ones by name; unmatched names become custom exercises, listed in the result. Up to 100 workouts per call; the same batch id on later calls makes one import, undone together. Workouts already imported from the same app are skipped.
| Parameter | Type | Description |
|---|---|---|
app * | string | Where these came from, e.g. "FitNotes", "JEFIT", "Notes app". |
workouts * | array | |
batch | string | Returned by the first call; pass it on later calls in the same import. |
unit | string | Unit for every weight in this call. Defaults to the person's own unit. |
trainrec_import_food Import food history from another app
Imports past meals from another nutrition app or file: each entry's day, meal, name, numbers PER SERVING and servings. Up to 200 entries per call; the same batch id on later calls makes one import, undone together. Entries already imported from the same app are skipped.
| Parameter | Type | Description |
|---|---|---|
app * | string | Where these came from, e.g. "MyFitnessPal". |
entries * | array | |
batch | string | Returned by the first call; pass it on later calls in the same import. |
trainrec_undo_import Undo an import
Removes everything one import added, given its batch id. All or nothing: refused if any of it has been edited since.
| Parameter | Type | Description |
|---|---|---|
batch * | string |
trainrec_reminders List reminders
The person's reminders (notifications on their phone): what each says, when, whether it is on, and who set it up. Read-only. Each has its last 30 days (history: sent, opened, doneAfter: how often what it asked for got done that day after it went off), and ideas lists alerts their own last week points to, ready to propose.
trainrec_set_reminder Set a reminder
Reminders are TrainRec's notifications on the person's phone. They start at zero: none exist until the person asks their assistant (you) to set one up, so when they ask to be reminded of something, this is how. Adds a reminder, or changes one (give its id and version). Kinds: weigh_in, log_food (optionally one meal), workout (names today's planned workout if there is one) and streak (training weeks in a row, sent only if this week has no workout yet) go at a local time, and each is skipped that day once it is done. goal goes when a daily number is approaching or has reached its target (calorie…
| Parameter | Type | Description |
|---|---|---|
kind * | string | |
amount | object | threshold and check only. |
at | string | Local time, HH:MM 24-hour, as the person says it. Required for every kind but goal; ask them if they didn't say. |
date | string | workout only: the one day it is for, YYYY-MM-DD, instead of days. |
days | array | 1 = Monday to 7 = Sunday. Leave out for every day. |
goal | object | goal only. |
id | string | To change an existing reminder. Leave out to add one. |
meal | string | log_food only. |
on | boolean | Default true. false keeps it but sends nothing. |
proposed | boolean | true when the person left the time or amount to you: kept off until they approve it in the app. |
streak | string | streak only. training_weeks: weeks in a row with a workout; training_days: days in a row with a workout or food logged. |
text | string | custom only. What it says, up to 80 characters: "Take creatine". |
version | integer | Required with id. |
trainrec_delete_reminder Delete a reminder
Removes one reminder, given its id and version. To stop it for a while instead, set_reminder with on false. The person can undo it in the app.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
version * | integer |
trainrec_find_issues Find known issues
Bugs and ideas already sent to the TrainRec team that look like what the person describes, best match first, with whether each is fixed. Call this before report_issue: if one matches, add to it rather than sending a new one. Read-only.
| Parameter | Type | Description |
|---|---|---|
query * | string | What went wrong or what they want, in a few words. |
trainrec_report_issue Report a bug or idea
Send a bug or an idea to the TrainRec team, only after the person agrees to. Call find_issues first: if an issue matches, pass its issueId with what this person adds; otherwise pass kind, title and details for a new one. Say what happened and where in the app, never anything about their health beyond what the bug needs.
| Parameter | Type | Description |
|---|---|---|
details * | string | What happened, where in the app, and what they expected; or, with issueId, what this person adds. |
issueId | integer | A matching issue from find_issues. |
kind | string | |
title | string | A new issue: one plain line, like "Rest timer does not show on the watch". |
trainrec_remember Remember for every chat
Saves something to keep in mind from now on, in a few words ("Left knee hurts on deep squats", "Goal: 10K in April", "No dairy"). Never medical history: no conditions, diagnoses, medications or surgeries. With id and version, replaces that one. The person sees it in the app, can delete it, and can undo it in Changes.
| Parameter | Type | Description |
|---|---|---|
text * | string | |
id | string | |
version | integer |
trainrec_forget Forget something remembered
Removes something saved with trainrec_remember, by the id and version in overview.rememberedAboutThem.
| Parameter | Type | Description |
|---|---|---|
id * | string | |
version * | integer |
trainrec_merge_workouts Merge two workouts
Makes two workouts of one session into one, given both ids and versions: keep keeps its id and name and takes the other's exercises and what either measured (calories, heart rate, route), and the other is removed. For the same session logged twice, or a watch's copy of one you logged. Same day only. The person can undo it in one step in the app. Use it instead of deleting one of the pair: a watch's heart rate is only on its copy.
| Parameter | Type | Description |
|---|---|---|
keep * | string | |
keepVersion * | integer | |
other * | string | |
otherVersion * | integer |
trainrec_move_exercise Move an exercise's history
Moves every set logged or planned under one exercise to another, in all their workouts and routines, when it was logged under the wrong one: a plate-loaded hack squat logged as Hack Squat (Machine), a dumbbell press logged as the barbell one. Both must log the same things (weight and reps, say). The sets are not changed. baseWeight, in the person's unit, sets what the new exercise's sled or bar weighs empty (plate-loaded and Smith only). One step to undo in the app.
| Parameter | Type | Description |
|---|---|---|
from * | string | Exercise id the sets are under now (list_exercises). |
to * | string | Exercise id to move them to. |
baseWeight | number | The new exercise's sled or bar, empty, in the person's unit. |
trainrec_how_to How to do an exercise
How to do one exercise, when they ask how to do it or what good form looks like: its steps, in their language, and a link that opens TrainRec with it animated and the steps following the rep. Some show the same movement on other equipment and have no steps; then explain it yourself. Give the steps briefly in your own words, then the link.
| Parameter | Type | Description |
|---|---|---|
exerciseId * | string | list_exercises shows the ids. |