Skip to main content
Glama

aiTrainer

Personal workout coach as a Python MCP server for OpenClaw. Chat over Telegram, log exercises in natural language, and let the agent read structured progress from SQLite.

Features

  • Log exercises, sets, reps, weights, optional RPE, and notes

  • Automatic workout session grouping (same day + within idle timeout)

  • Exercise aliases (bench, bench press, etc.)

  • Progress signals: estimated 1RM, personal bests, volume trend, sessions since last increase

  • MCP stdio transport for OpenClaw

Related MCP server: super-hevy-mcp

Requirements

  • Python 3.11+

  • Linux target machine (also works on macOS for development)

Install

python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

Run locally

aicoach-mcp

Or:

python -m aicoach.server

Configuration

Environment variables:

Variable

Default

Description

AICOACH_DB_PATH

~/.local/share/aicoach/aicoach.db

SQLite database path

AICOACH_DEFAULT_UNIT

kg

Default weight unit

AICOACH_IDLE_TIMEOUT_SECONDS

10800 (3h)

Auto-close idle workout sessions

OpenClaw setup

Add aiCoach to your OpenClaw MCP config. On a standard install this lives in ~/.openclaw/openclaw.json.

Option A: CLI helper

openclaw mcp set aicoach '{
  "command": "/path/to/aicoach/.venv/bin/aicoach-mcp",
  "env": {
    "AICOACH_DB_PATH": "/home/you/.local/share/aicoach/aicoach.db"
  }
}'

Option B: direct JSON config

{
  "mcpServers": {
    "aicoach": {
      "command": "/path/to/aicoach/.venv/bin/aicoach-mcp",
      "args": [],
      "env": {
        "AICOACH_DB_PATH": "/home/you/.local/share/aicoach/aicoach.db"
      }
    }
  }
}

Notes:

  • A command field means OpenClaw launches the server over stdio automatically.

  • Use the absolute path to your virtualenv binary on the Linux host.

  • Restart or reload OpenClaw after changing MCP config.

Agent prompt

Copy prompts/coach_instructions.md into your OpenClaw agent instructions so the model knows when to call aiCoach tools.

MCP tools

Tool

Purpose

log_workout

Log one exercise and attach it to the current session

get_current_workout

Show the open session and exercises logged so far

get_session

Fetch one session with set ids for editing

get_exercise_history

Recent sessions for one exercise

get_recent_workouts

Recent sessions across exercises

get_progress

Coaching signals for one exercise

list_exercises

Known exercises and aliases

update_session

Change a session date or note

update_workout_set

Update one set by id

delete_session

Delete an entire workout session

delete_exercise_from_session

Delete one exercise from a session

merge_sessions

Merge source sessions into one target session

Example tool input

{
  "exercise": "squat",
  "sets": [
    {"reps": 5, "weight": 100},
    {"reps": 5, "weight": 100},
    {"reps": 5, "weight": 100}
  ],
  "note": "moved well"
}

Tests

pytest

MCP stdio smoke test:

python scripts/mcp_smoke_test.py

OpenClaw example config

See examples/openclaw-mcp-snippet.json for a copy-paste MCP server entry.

Project layout

aicoach/
  config.py      # settings and env vars
  db.py          # sqlite schema
  repository.py  # storage and session logic
  progress.py    # coaching signals
  server.py      # MCP server
prompts/
  coach_instructions.md
tests/

Available Tools

6 tools
get_current_workoutA

Return the open workout session and all exercises logged so far today.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided; description adequately states 'returns' but does not disclose behavior when no open session exists or if multiple exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single clear sentence with no redundant information, front-loaded purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no parameters and an output schema existing, the description fully explains what the tool returns.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters in schema, so description does not need to add param info; baseline score of 4 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool returns the open workout session and exercises logged today, distinguishing it from siblings like get_exercise_history and log_workout.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implied usage for retrieving current workout, but no explicit guidance on when not to use or alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_exercise_historyB

Return recent workout sessions for a single exercise.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
exerciseYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It only says 'Return', implying read-only, but does not explicitly confirm non-destructiveness, mention authorization needs, or define 'recent' (e.g., time window or number of sessions). This leaves significant gaps for an agent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-formed sentence with no wasted words. However, it is slightly too brief to cover important aspects, but conciseness is appropriately high for what it offers.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the low complexity (2 parameters, simple types) and the presence of an output schema, the description is minimally viable. But it lacks details on ordering, time range, or default behavior (e.g., 'recent' implies last N sessions, but N is default 10). It is adequate but has clear gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description should add meaning. It mentions 'for a single exercise' but does not explain the 'exercise' parameter's format or values, and ignores the 'limit' parameter entirely. The description adds minimal semantic value beyond the parameter names.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool returns recent workout sessions for a single exercise, using specific verb 'Return' and resource 'workout sessions for a single exercise'. This distinguishes it from siblings like get_recent_workouts (likely for all exercises) and get_current_workout.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives, no prerequisites, and no context on usage scenarios. It is a minimal statement without any usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_progressB

Return coaching signals such as estimated 1RM, volume trend, and PRs.

ParametersJSON Schema
NameRequiredDescriptionDefault
exerciseYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist; the description only states it returns data but lacks details on auth requirements, error handling, or output format, leaving the agent with minimal behavioral context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, no fluff, but could be slightly more informative without losing conciseness. Loses a point for being too minimal.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Missing key context like whether progress is for a single exercise or all, the exact nature of 'coaching signals,' and how the output relates to the input parameter, despite having an output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The only parameter 'exercise' has no description in schema and the tool description does not explicitly state that progress is per exercise; it only implies through examples. With 0% schema coverage, the description should compensate but does not.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states 'Return coaching signals' with specific examples (1RM, volume trend, PRs), and the verb+resource is distinct from sibling tools like get_exercise_history or get_current_workout.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implies usage when progress data is needed, but no explicit guidelines on when to use this vs. siblings or when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_recent_workoutsC

Return recent workout sessions across all exercises.

ParametersJSON Schema
NameRequiredDescriptionDefault
daysNo
limitNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

C2.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It does not mention ordering, read-only nature, privacy, or data freshness. Minimal behavioral context beyond basic output.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence is concise but omits critical information. Conciseness alone does not compensate for lack of utility.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having an output schema, description fails to clarify parameter semantics or behavioral context. Agent cannot reliably invoke the tool without assumptions.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and description adds no explanation for parameters 'days' or 'limit'. Agent cannot infer their meaning or constraints without additional context.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states 'return recent workout sessions across all exercises', specifying verb and resource. It distinguishes from sibling tools like get_current_workout and get_exercise_history, but 'recent' is vague without a time range.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. Agent must infer usage from context signals alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_exercisesA

List known exercises and aliases to help normalize exercise names.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It only states the action (list) and purpose, but does not disclose read-only nature, auth needs, rate limits, or any side effects. Output schema exists but is not described.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence with no wasted words. It is front-loaded and efficient, earning its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no parameters and an output schema, the description is adequate but lacks behavioral transparency and usage guidelines. It fulfills the basic purpose but leaves gaps for an agent to infer safety and context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters exist, and schema coverage is 100% by default. According to rules, 0 params yields a baseline of 4; the description does not need to add parameter info.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a clear verb 'list' and resource 'known exercises and aliases', with a specific purpose 'help normalize exercise names'. It distinguishes from sibling tools like get_exercise_history or get_current_workout.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives, or any prerequisites. The purpose implies lookup, but no explicit when/when-not context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

log_workoutA

Log sets for one exercise and attach them to the current open workout session.

ParametersJSON Schema
NameRequiredDescriptionDefault
noteNo
setsYes
exerciseYes
performed_onNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided. Description discloses core action (attaching sets to current workout) but lacks details on error handling, idempotency, or side effects if no session exists.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence of 12 words, no redundancy, clearly front-loads action and context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema exists so return values are handled. Description covers main purpose but misses usage prerequisites and behavioral constraints.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% (description doesn't mention parameters), but schema itself provides parameter descriptions (e.g., reps, weight). Baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states verb 'log', resource 'sets for one exercise', and context 'attach to current open workout session'. Distinguishes from sibling tools like get_current_workout or list_exercises.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this tool vs alternatives. Does not mention prerequisites (e.g., need an open workout session) or when not to use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 6 tool updatesv0.1.0
    • First observedget_current_workout
    • First observedget_exercise_history
    • First observedget_progress
    • First observedget_recent_workouts
    • First observedlist_exercises
    • First observedlog_workout

TDQS

A3.5/5.0

Scored across 6 tools

Disambiguation5/5

Each tool targets a distinct aspect: current workout, exercise history, progress, recent workouts, exercise list, and logging. No overlap in purpose.

Naming Consistency5/5

Every tool follows a consistent verb_noun pattern (get_, list_, log_), with no mixing of styles or vague verbs.

Tool Count5/5

With 6 tools, the server is well-scoped for a workout tracking assistant—not too few, not too many.

Completeness4/5

Covers core needs: listing exercises, logging, viewing current workout, history, and progress. Minor gap: no explicit create/close session, though log_workout may implicitly open one.

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    B
    quality
    D
    maintenance
    A personal fitness tracking server that enables logging and querying workouts, nutrition, and body metrics through a local SQLite database. Integrates with OpenNutrition MCP for food logging and supports exercise history tracking for workout progression.
    17
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    MCP server for the Hevy workout tracker that enables users to query training history, log workouts, and manage routines via natural language.
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Self-hosted fitness tracking MCP server that gives AI assistants access to your nutrition, training, weight, sleep, and accomplishment data via 77 tools and 5 resources. Enables natural-language logging and querying of personal health metrics through Claude or ChatGPT.
    1
    BSD 2-Clause "Simplified"