Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
SELFCOACH_HOMENoWhere tokens and the database live.~/.selfcoach
SELFCOACH_CHINANo1 for accounts on garmin.cn.0
SELFCOACH_DB_URLNoAny SQLAlchemy URL; Postgres needs the postgres extra.sqlite:///$SELFCOACH_HOME/garmin.db
SELFCOACH_TOKENSNoToken directory.$SELFCOACH_HOME/tokens
SELFCOACH_LANGUAGENoLanguage for the slash commands, e.g. Italian; empty = the language you write in.
SELFCOACH_ALLOW_WRITENo0 = read-only: never write to Garmin Connect.1
SELFCOACH_AUTO_SYNC_MINUTESNoRe-sync recent days when data is older than this.30
SELFCOACH_INITIAL_SYNC_DAYSNoHistory downloaded on first use if you skipped sync.60

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Garmin Connect training companion. You act as the athlete's coach: most users train without a human coach. Data is synced to a local database and tools return compact Markdown summaries.

Daily loop: today_status gives a readiness-based suggestion (rest / easy / moderate / hard) -> agree on today's session -> schedule_workout puts it on the Garmin calendar so it runs step by step on the watch -> after training, analyze_session and add_note (RPE, feelings) -> weekly_review on Sunday to plan the next week. Use set_goal once to record the target event: phase-aware advice depends on it. Slash commands (MCP prompts) wrap these flows: start, today, plan, week, log, progress, goal, coach_report. trends shows 4-52 week patterns plus insights Garmin does not compute (intensity distribution, monotony/strain, ramp rate, rest days). chart_data returns JSON for visual reports.

Rules: never schedule or remove workouts without the athlete agreeing first. If a workout comes from a human coach (source "coach", e.g. Garmin Clipboard) never change it: suggest adjustments for the athlete to discuss with the coach. Suggestions are training guidance, not medical advice: for pain, illness or unusual symptoms tell the athlete to see a professional. Laps in motocross are motos. Reply in the user's language.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
today_statusA

Start here every day. Suggests what kind of session suits today (rest / easy / moderate / hard) with the reasons, from resting HR vs 4-week baseline, Training Readiness, Body Battery, acute/chronic load, HRV, sleep, recent hard sessions and days without rest. Also shows the goal and training phase, today's planned workout and the last 3 days. day is YYYY-MM-DD (default today).

plan_vs_doneA

Planned vs executed for the Monday-Sunday week containing week_of (YYYY-MM-DD, default this week): each planned workout (source self, AI plan or coach) marked done/missed/upcoming with duration, HR, Z4+Z5 minutes and sets, plus unplanned sessions, adherence % and weekly load. Shows the calendar item id needed by remove_workout.

analyze_sessionA

Deep dive into one activity (by id, else the latest on day, else the latest overall): HR zones, per-lap table with cardiac drift, strength exercises with sets/reps/load, comparison with the planned workout, athlete notes and an RPE vs heart-rate consistency check.

trendsA

Weekly table for the last weeks weeks (sessions, hard sessions, volume, load, Z4+Z5, resting HR, stress, Body Battery, readiness, ACWR), sport mix, VO2max change and insights: intensity distribution vs 80/20, training monotony and strain, ramp rate, rest days, resting HR drift, average RPE. Use for fatigue, overreaching, plateaus and progress.

weekly_reviewA

Weekly review for the week containing week_of: goal and phase, plan adherence, sessions, 4-week trends with insights and athlete notes. Use it to plan next week. With for_coach=True it is formatted as a report to send to a human coach (includes the athlete's name).

list_activitiesB

Activities of the last days days with id, optionally filtered by sport (e.g. 'running', 'strength', 'cycling', 'moto').

chart_dataA

Compact JSON for charts and visual reports: daily metrics (resting HR with rhr_reliable false when no sleep was recorded, readiness, Body Battery, acute/chronic load, stress, VO2max), activities with HR zones and strength sets, planned workouts matched to what was done, notes and goals. Defaults to the last 28 days. Dates are YYYY-MM-DD.

add_noteB

Save a note in the training journal: perceived effort rpe (1-10), feelings, pain, sleep, conditions. Linked to the day's activity when there is only one. Notes appear in analyze_session, trends and weekly_review. Stored locally only.

set_goalA

Record the athlete's goal so advice follows a training phase (base, build, peak, taper, race week). title e.g. 'Half marathon under 1h45'; event_date YYYY-MM-DD if there is a target event; details for constraints such as available days, hours per week, equipment, injuries. clear=True removes previous goals (combine with a title to replace them). Stored locally only.

schedule_workoutA

Create a structured workout and put it on the Garmin Connect calendar for day (YYYY-MM-DD). It syncs to the watch, which then guides each step. Only call after the athlete agreed; use preview=True to show it without sending.

`sport`: running, cycling, strength, cardio, hiit, walking, hiking, yoga,
mobility, swimming or other (use other/cardio for sports Garmin has no workout
type for, e.g. motocross).

`steps` is a list of objects:
- timed/distance step: {"type": "warmup"|"interval"|"recovery"|"rest"|"cooldown",
  one of "minutes" | "seconds" | "km" | "meters" (omit for 'press lap to continue'),
  optional target: "hr_zone" (1-5) | "hr_bpm" [low, high] | "power_zone" |
  "watts" [low, high] | "pace_per_km" ["5:40", "5:20"] | "cadence" [low, high],
  optional "note"}
- repeat: {"type": "repeat", "times": 5, "steps": [...]}
- strength exercise: {"type": "exercise", "name": "Barbell Back Squat",
  "sets": 4, "reps": 8 (or "seconds": 45 for holds), "kg": 60,
  "rest_seconds": 90, "note": "..."}. Names must match Garmin's exercise catalog;
  an unknown name returns the closest matches.

Example (intervals): [{"type":"warmup","minutes":15,"hr_zone":2},
{"type":"repeat","times":5,"steps":[{"type":"interval","minutes":3,"hr_zone":4},
{"type":"recovery","minutes":2,"hr_zone":1}]},{"type":"cooldown","minutes":10}]
remove_workoutA

Remove from the Garmin calendar a workout that this server scheduled (ids are in plan_vs_done). Workouts from a coach or other apps are never removed. Only call after the athlete agreed.

sync_garminA

Download the last days days from Garmin Connect (activities, calendar, daily metrics). Tools already auto-sync recent days; use this for a deeper backfill (up to 730 days) or with force=True to refresh days already stored.

Prompts

Interactive templates invoked by user choice

NameDescription
startFirst run: checks your data, records your goal and explains the daily routine.
todayMorning check: readiness, suggested session for today, option to send it to the watch.
planBuilds one structured workout and puts it on your Garmin watch after your OK.
weekSunday routine: reviews the week and plans next week's sessions on your watch.
logAfter training: analyses the session and saves your RPE and feelings.
progressTrends over several weeks: fitness, fatigue, consistency and what to change.
goalRecords your target event and constraints so advice follows the right phase.
coach_reportWeekly report ready to send to a human coach.

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A3.9/5.0

Scored across 12 tools

Disambiguation4/5

Most tools target clearly distinct actions or resources: sync, daily status, weekly review, trends, session analysis, scheduling, notes, and goals. A few reporting tools (chart_data, trends, weekly_review, plan_vs_done) surface overlapping training data, but their descriptions distinguish formats and use cases.

Naming Consistency4/5

All names use snake_case and are readable. Most are verb_noun (sync_garmin, analyze_session, list_activities, add_note, set_goal, schedule_workout, remove_workout), but several are noun phrases (today_status, plan_vs_done, trends, weekly_review, chart_data), so the convention is not fully predictable.

Tool Count5/5

The 12 tools are well-scoped for a self-coaching server covering sync, analysis, planning, review, notes, goals, and workout scheduling. Each tool appears to earn its place without excessive surface area.

Completeness4/5

The surface covers the core lifecycle: data sync, activity analysis, trends, weekly review, planning, workout scheduling/removal, notes, and goals. Minor gaps exist, such as no update/edit operation for scheduled workouts and no update/delete for notes, though remove-and-recreate workarounds are available.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues