databasedmcp

← Articles

How to build a workout log with ChatGPT

Log your sets by telling ChatGPT what you lifted, then ask about your progress, your best lifts and what you did last time.

6 min read

databasedmcp gives your AI assistant databases it keeps between conversations, so everything in this article works from the day you connect it. Free to start, no card.

Get started free

Why build it yourself

Strong and Hevy are built around one loop: you do a set, log the weight and reps, and later look at how the numbers moved. For a lot of people that's the whole app. The routines, the social feed and the charts are extras.

A log of sets is three tables. After a session, tell ChatGPT what you did in the words you'd use with a training partner, and it writes the rows. The questions you'd scroll an app for become a sentence: what did I squat last week, and am I getting stronger?

Connect ChatGPT to databasedmcp

databasedmcp is a remote MCP server that gives AI assistants private SQLite databases, with nothing to install.

ChatGPT connects to remote MCP servers as custom connectors in developer mode. That's on paid plans, on the web. Turn on developer mode in ChatGPT's settings, then create a connector: give it a name, enter https://databasedmcp.com/mcp as the URL and choose OAuth. When ChatGPT opens a databasedmcp page, sign in and select Allow. In a new chat, turn the connector on from the tools menu.

ChatGPT moves these menus between releases. If yours look different, search its settings for developer mode and custom connectors.

Any other MCP client works the same way; the docs have the details.

Copy this prompt to build it

Paste this into ChatGPT to set up the database, its tables and its guide in one go. The rest of this article walks through what it makes and how you use it.

prompt
Set up a workout log for me in databasedmcp, in one go.

1. Create a database called workouts, described as "Workout log: exercises, sessions and sets, logged by ChatGPT from what I tell it after training."
2. Create three tables:
   - exercises: id, name (required and unique, like "Back squat"), muscle_group (required).
   - workouts: id, done_on (date, defaults to today), notes (how it felt).
   - sets: id, workout_id (references workouts, required), exercise_id (references exercises, required), set_no (the order within the workout, required), reps (required), weight_kg (defaults to 0 for bodyweight), rpe (effort from 1 to 10, only if I mention it).
3. Write the database a guide that says what each table is for, to reuse an existing exercise name before adding a new one, that sets are one row each in order, and the query for "the last time I did an exercise", plus the estimated one-rep max formula: weight_kg * (1 + reps / 30.0).

From then on: when I tell you about a session, add a workout for the day with how it felt, then log every set with its number, reps, weight and effort if I gave one, adding any exercise that's new. Show me the tables when you're finished.

Ask for the database

You don't write the schema. Describe what you want:

Set up a workout log in databasedmcp: the exercises I do and their muscle group, each workout I do, and every set with weight and reps. After a session I'll tell you what I did; log it.

ChatGPT creates a database called workouts and its tables:

schema
CREATE TABLE exercises (
  id INTEGER PRIMARY KEY,
  name TEXT NOT NULL UNIQUE,
  muscle_group TEXT NOT NULL
);

CREATE TABLE workouts (
  id INTEGER PRIMARY KEY,
  done_on TEXT NOT NULL DEFAULT (date('now')),
  notes TEXT
);

CREATE TABLE sets (
  id INTEGER PRIMARY KEY,
  workout_id INTEGER NOT NULL REFERENCES workouts(id),
  exercise_id INTEGER NOT NULL REFERENCES exercises(id),
  set_no INTEGER NOT NULL,
  reps INTEGER NOT NULL,
  weight_kg REAL NOT NULL DEFAULT 0,
  rpe REAL CHECK (rpe BETWEEN 1 AND 10)
);

It also writes the database a guide on how the tables are meant to be used. The guide comes back with the schema whenever an assistant looks the database up. ChatGPT files things the same way next week as today, and so does any other assistant you connect.

guide
# workouts: exercises, workouts, sets

- **exercises**: one row per exercise, names unique ("Back squat", not "squats"). Reuse an existing name before adding one.
- **workouts**: one row per session, with the date and how it felt.
- **sets**: one row per set, in order. `weight_kg` is the load (0 for bodyweight), `rpe` effort from 1 to 10 if I mention it.

Last time I did an exercise: `SELECT w.done_on, s.set_no, s.reps, s.weight_kg FROM sets s JOIN workouts w ON w.id = s.workout_id JOIN exercises e ON e.id = s.exercise_id WHERE e.name = ? ORDER BY w.done_on DESC, s.set_no LIMIT 10`

Estimated one-rep max (Epley): weight_kg * (1 + reps / 30.0).

Use it

From here on you talk, and ChatGPT writes the rows. Each request below is one statement:

I do back squats, bench press, deadlifts and pull-ups. Add them.
execute
INSERT INTO exercises (name, muscle_group) VALUES (?, 'legs'), (?, 'chest'), (?, 'back'), (?, 'back')
-- params: ["Back squat","Bench press","Deadlift","Pull-up"]
Finished leg day. Felt strong.
execute
INSERT INTO workouts (notes) VALUES (?) RETURNING id
-- params: ["Leg day. Felt strong."]
Squats: 3 sets of 5 at 100 kg, then one set of 3 at 110, that one was hard.
execute
INSERT INTO sets (workout_id, exercise_id, set_no, reps, weight_kg, rpe) VALUES (?, ?, 1, 5, 100, NULL), (?, ?, 2, 5, 100, NULL), (?, ?, 3, 5, 100, NULL), (?, ?, 4, 3, 110, 9)
-- params: [1,1,1,1,1,1,1,1]
And 3 sets of 8 pull-ups to finish.
execute
INSERT INTO sets (workout_id, exercise_id, set_no, reps) VALUES (?, ?, 1, 8), (?, ?, 2, 8), (?, ?, 3, 8)
-- params: [1,4,1,4,1,4]

Ask it questions

Once there's data, each report you'd pay for is a single query:

What's my best squat?
query
SELECT w.done_on, s.reps, s.weight_kg, round(s.weight_kg * (1 + s.reps / 30.0), 1) AS est_1rm FROM sets s JOIN workouts w ON w.id = s.workout_id JOIN exercises e ON e.id = s.exercise_id WHERE e.name = ? ORDER BY est_1rm DESC LIMIT 3
-- params: ["Back squat"]

The estimated one-rep max uses the Epley formula, so a heavy triple and a lighter set of five compare fairly.

How much work did I do per muscle group each week, for the last two months?
query
SELECT strftime('%Y-%W', w.done_on) AS week, e.muscle_group, count(*) AS sets, round(sum(s.reps * s.weight_kg)) AS volume_kg FROM sets s JOIN workouts w ON w.id = s.workout_id JOIN exercises e ON e.id = s.exercise_id WHERE w.done_on >= date('now', '-56 days') GROUP BY week, e.muscle_group ORDER BY week, e.muscle_group
What haven't I trained in over a week?
query
SELECT e.name, max(w.done_on) AS last_done FROM exercises e LEFT JOIN sets s ON s.exercise_id = e.id LEFT JOIN workouts w ON w.id = s.workout_id GROUP BY e.id HAVING last_done IS NULL OR last_done < date('now', '-7 days') ORDER BY last_done

You can also open the database on the website, page through its rows and run read-only SQL yourself.

What you give up

Logging between sets is slower. Strong and Hevy are built for the gym floor: tap a set done, start the rest timer, see last week's numbers next to this week's. Typing to a chat with sweaty hands isn't that, so most people who use this log the session afterwards from memory or a note.

There's no exercise library with videos, no watch or health app sync and no feed of friends' workouts. Charts appear only when you ask ChatGPT to draw one from a query. If those extras keep you training, stay with the app. If you want your numbers somewhere you can ask questions of, this does that.

Try it

databasedmcp is free to start, with no card. Free has 100 tool calls a week, enough to set this up and try it for a week. Starter has 1,000 for everyday use.

Create an account

More articles · databasedmcp · Docs