Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
GARMIN_EMAILNoEmail for first login only.
GARMIN_REDACTNoget_activity full leaves out name, profile/photo URLs, device and sensor serials and GPS; false returns raw as sent.true
GARMIN_REGIONNoRegion; 'cn' switches all three hosts.global
GARMIN_DATA_DIRNotokens, database, config.json~/.garmin-mcp
GARMIN_MCP_HOSTNoHost for streamable HTTP.127.0.0.1
GARMIN_MCP_PORTNoPort for streamable HTTP.8000
GARMIN_PASSWORDNoPassword for first login only.
GARMIN_TIMEZONENoIANA zone for 'today'.system
GARMIN_LOG_LEVELNoLog level for pino JSON on stderr.info
GARMIN_AUTO_FETCHNoRead tools download missing data themselves; false means only explicit syncs.true
GARMIN_APP_VERSIONNoOverride mobile app version (for when Garmin changes the mobile app identity).built in
GARMIN_CONCURRENCYNoParallel connectapi requests.4
GARMIN_TOKENS_FILENoPath to tokens file.$GARMIN_DATA_DIR/tokens.json
GARMIN_BROWSER_PATHNoChrome/Edge/Brave/Chromium used for the sign-in window.detected
GARMIN_SSO_STRATEGYNoSSO strategy: auto (browser if installed, else terminal), browser, curl, fetch, import.auto
GARMIN_SYNC_PAUSE_SNoPause between sync chunks in seconds; a random range or a fixed number.1-11
GARMIN_DI_CLIENT_IDSNoOverride mobile app client IDs (for when Garmin changes the mobile app identity).built in
GARMIN_ENABLED_TOOLSNoComma-separated allow list of tools.
GARMIN_MCP_TRANSPORTNoTransport: stdio or streamable-http.stdio
GARMIN_APP_USER_AGENTNoOverride mobile app user agent (for when Garmin changes the mobile app identity).built in
GARMIN_DISABLED_TOOLSNoComma-separated deny list of tools.
GARMIN_MCP_HTTP_TOKENNoBearer token for streamable HTTP authentication; without it only binds to 127.0.0.1.
GARMIN_SYNC_CHUNK_DAYSNoSync chunk size in days.7
GARMIN_FIT_DOWNLOAD_DIRNoDirectory for downloaded activity files.$GARMIN_DATA_DIR/downloads
GARMIN_ENABLE_DESTRUCTIVENoEnable delete tools and workout overwrite.false
GARMIN_HTTP_ALLOWED_HOSTSNoComma-separated hostnames (no port, IPv6 in brackets) accepted in Host/Origin on top of localhost, 127.0.0.1, [::1]; others get 403.
GARMIN_MIN_REQUEST_INTERVAL_MSNoSpacing between request starts (±25% jitter).250
GARMIN_SYNC_MAX_REQUESTS_PER_DAYNoMaximum requests per day for syncs.600

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 data for the signed-in user, served from a local cache. Read tools download data that is not in the cache yet by themselves (within the daily Garmin request limit), so just call them and answer; there is no need to ask about or describe syncing. If auto fetch is turned off (GARMIN_AUTO_FETCH=false), missing data comes back as meta.sync_hint; then ask the user before calling garmin_sync with it.

  • Dates are YYYY-MM-DD in the user's local time zone; "today" is resolved by the server.

  • Prefer one coarse call (query_health with several metrics, get_period_summary) over many small ones.

  • Every result has meta.source: "cache", "live", "partial" or "local" (computed by the server without Garmin, e.g. create_workout with dry_run: true). On "partial", mention briefly that some days are still downloading (meta.note says when to ask again). meta.fetched_at is when the oldest record in the answer was downloaded; newer ones may be fresher.

  • Errors come back as {"error":{"code","message","hint"}}; relay the hint to the user (e.g. to run garmin login).

  • Every result is also in structuredContent (the same JSON, typed by the tool's outputSchema), and a workout is saved only after you showed the user its steps from create_workout with dry_run: true and they agreed.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
prompts
{
  "listChanged": true
}
resources
{
  "listChanged": true
}
completions
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
garmin_syncA

Download data from Garmin Connect into the local cache. Read tools already download missing data by themselves, so call this only when the user asks to sync/refresh or to pre-load a range, or when a tool returned meta.sync_hint (auto fetch turned off) and the user agreed; pass the hint's scope/from/to. Days already stored are skipped. Long ranges continue in the background: this waits at most 20 s and reports progress (also in garmin://sync-status).

get_activitiesA

List workouts/activities (runs, rides, swims, strength...) as dense summaries: id, date, type, name, duration, distance, pace or speed, GAP, HR, power, NP, cadence, training load and Training Effect, temperature (if weather downloaded), event_type when tagged (e.g. race). Use for "what did I do last week", finding an activity id, or comparing sessions. For one activity in depth use get_activity; for weekly/monthly totals use get_period_summary.

get_activityA

Details of one activity by id. detail="summary" (default) for the overview incl. description, RPE, feel, GAP, running dynamics (cadence, GCT, balance, VO, VR, stride), breathing rate, stamina, Training Effect label, run/walk/stand time, HR source (strap or watch) and workout_id (for get_workout); "splits" adds laps with the same dynamics, intensity (warmup, active, rest...) and, for a workout, the step as get_workout numbers it (wkt_step) and its compliance, plus typed splits (run, walk, stand, ClimbPro climbs) with totals per type; "hr_zones" adds time in HR zones; "power_zones" adds time in power zones (power meter); "weather" adds temperature, wind and conditions during the activity; "exercise_sets" adds strength sets (exercise, reps, weight, rest); "stream_summary" aggregates the stream per bucket (pace, GAP, HR, power, dynamics, breathing, Performance Condition, elevation, stamina; compares halves or kilometres without raw samples); "power_curve": best power for 1 s to 60 min (W, W/kg) from the FIT file, also running power; "full" adds all sections except power_curve plus the raw stream (HR, pace, power...), 50 KB per page (narrow it with metrics and downsample_s) - only when the user needs raw samples.

update_activityA

Change an activity in Garmin Connect: name, type, event_type (e.g. race), description (notes), rpe, feel, privacy, or the gear used: add_gear puts shoes or a bike on it, remove_gear takes one off (swap: both in one call). Without id it adds a manual activity (type, start, duration_min; optional distance_km, name, description, rpe, feel, privacy, default private): show the user these values and call after they agree. Only call when the user asked for the change. Returns the activity after the edit.

download_activity_fileA

Download one activity from Garmin Connect and save it as a file on this machine (fit, gpx, tcx, kml or csv), returning its path and size. Use it when the user wants the file itself, e.g. to import into another app; to read an activity's numbers, laps or streams in the answer use get_activity instead. Prefer fit, the original recording, unless the destination needs another format. The file is named . and replaces an earlier download of the same activity and format; every call fetches it from Garmin again.

query_healthA

For "how did I sleep this week", "calories and intensity minutes this week", "steps yesterday" or any single health metric over days: a table per day or per ISO week plus summary with averages, totals, min/max and 7/28-day trend. steps also returns the daily distance in km, resting_hr the daily min/max HR, hrv the Garmin HRV status and baseline range, calories the kcal burned (total, active) and eaten (calories_consumed_kcal, absent without food log entries), hydration the ml drunk, goal and sweat loss (days without a water entry are left out). Ask for several metrics in one call (e.g. calories and intensity_minutes together). Use get_sleep for sleep stages of particular nights. Example: {"metrics":["hrv","resting_hr","sleep"],"from":"2026-07-01","to":"2026-09-30","granularity":"week"}. "hour" gives hourly HR, stress, Body Battery, steps, respiration and SpO2 with peak and lowest hour and Body Battery events (sleep, activity, stress), for "when was I most stressed yesterday": {"metrics":["stress","body_battery"],"from":"2026-10-09","to":"2026-10-09","granularity":"hour"}.

get_sleepA

Sleep for one night with stages, score, SpO2, respiration, overnight HRV and a timeline (stage segments, awakenings, lowest HR, HRV and SpO2 with times), or for a range a per-night table with averages and trends. Use it for sleep stages and the detail of particular nights; for sleep hours next to other daily metrics, or months by week, use query_health. A night is named by the date of the morning it ended on: the night of 7 to 8 October is 2026-10-08. No arguments returns the last 7 nights; a range can span up to 3 years, one row per night. Nights not in the cache yet are downloaded from Garmin within the daily request limit, and a night without sleep data comes back as sleep null.

get_training_statusA

Fitness and fatigue: VO2max (running/cycling) with trend, training readiness, remaining recovery time, Garmin training status (productive, maintaining, ...), Garmin acute/chronic load and load focus (aerobic low/high, anaerobic vs. targets), and garmin_load_model: CTL/ATL/TSB from Garmin's daily training load (EPOC); the own TSS model (power, pace, HR) is get_load. metrics holds race predictions (5k to marathon), endurance and hill score, fitness age, personal records and heat/altitude acclimation as of the newest training sync on or before to. Set include_series for the daily load curve. Use it for "am I improving", VO2max, race predictions or Garmin's status; for a go/no-go today use get_readiness, for a week or month in numbers get_period_summary.

get_body_compositionA

Weigh-ins (kg, body fat %, muscle mass, BMI) in a range, each with its time, plus change over the range and trend. Use it for weight and body composition questions; query_health and get_period_summary carry no weight. Days without a weigh-in are simply absent; an empty range returns no weigh-ins, not an error.

get_period_summaryA

Training week or month at a glance: sessions and volume per sport, time in the Garmin HR zones 1-5 (for the 3-zone Z1/Z2/Z3 split against LT1/LTHR, e.g. time below LT1 or polarisation, use get_load), active vs rest days, longest and hardest session, garmin_load_model at the end (CTL/ATL/TSB from Garmin's daily training load (EPOC); the own TSS model is get_load), and only avg/min/max of sleep, HRV, resting HR, steps, stress and body battery plus average daily kcal. Day-by-day values and other metrics (calorie totals, intensity minutes, floors, respiration, SpO2) come from query_health, weight from get_body_composition. Weeks run Monday-Sunday. Period "range" gives the same for any from..to up to 366 days, e.g. a training block: {"period":"range","from":"2026-08-04","to":"2026-09-28"}.

list_workoutsA

List the saved workout library (workouts), the scheduled workouts (upcoming_schedule; Garmin Coach or other training plan ones have source: "plan") and the races or events the user added or subscribed to (upcoming_events). Use it for "my next race", "what is planned this week", "what does my plan say for Saturday" or "which workouts do I have", and to find a workout id or schedule_id. For the steps of one workout use get_workout, to put a workout on the calendar or take it off schedule_workouts, for sessions already done get_activities. sport and limit narrow only the library; from and to set only the calendar window: today and the next 60 days by default, any range up to 3 years, past or future. Calendar months not in the cache yet are downloaded on the way. In events primary marks the goal race of an active training plan; plan gives its phase and target event.

get_workoutA

Steps of one saved workout from the Garmin library in readable form: name, sport, description and one line per step (warm-up, repeats, duration or distance, target in pace/HR/power/cadence), plus estimated duration and distance. Use it to show what a planned session contains, or before changing it with create_workout; to find workouts or what is on the calendar use list_workouts. An id that no longer exists in Garmin Connect returns a NOT_FOUND error.

create_workoutA

Save a new structured workout to Garmin Connect (then use schedule_workouts to put it on the calendar so it syncs to the watch). Pass exactly one of: preset for a standard session from a few parameters (run_intervals, walk_run, easy_z2, strength_circuit); definition for anything else (typed steps with duration and target, nestable repeats); garmin_json only to copy an existing Garmin workout JSON. Errors name the bad field, e.g. steps[2].steps[0].target. Call with dry_run: true first, show the steps to the user and save only after they agree. dry_run saves nothing and does not contact Garmin: it returns the readable steps and the estimated duration.

schedule_workoutsA

Put saved workouts on the Garmin calendar (they then sync to the watch), or take them off it. unschedule takes schedule_id values (from list_workouts upcoming_schedule or an earlier schedule_workouts result); the workout stays in the library, only the calendar entry goes. Unschedule only what the user asked to remove. Unscheduling runs first, so moving a workout is one call. Returns a result per item. Examples: {"items":[{"date":"2026-10-10","workout_id":123}]}, {"unschedule":[456]}.

get_gearA

List the shoes, bikes and other gear on the Garmin account, active first: uuid, name, type, status (active or retired), total distance and activity count, the distance limit set in Garmin, in use since, retired date and notes. Use it for "how many km on my shoes" or "which shoes to replace", not for watches and sensors (get_devices); name or uuid is what update_activity takes as add_gear/remove_gear. Returns every item, no paging; none recorded gives an empty list.

get_devicesA

Garmin devices on the account with model, firmware, last sync time and settings (units, tones, alerts, pulse ox during sleep, alarms). Use it for "is my watch up to date" or "when did it last sync"; shoes and bikes are get_gear. Read from the cache, refreshed from Garmin at most hourly; no devices gives an empty list.

get_loadA

Training load from the server's own transparent model: TSS per activity from power, else pace, else heart rate, else session RPE, with the thresholds in effect on each date. Use it for fitness, fatigue and form trends, ramp rate, weekly volume and intensity distribution (time below LT1, % in Z1, polarisation). Not Garmin's EPOC load: Garmin's status and CTL/ATL/TSB from Garmin's load are get_training_status, a go/no-go for today get_readiness. Returns CTL/ATL/TSB, ACWR, monotony and strain on to (latest), warning flags, ISO weeks per sport (sessions, hours, km, TSS, hrTSS, Garmin load, hours in Z1-2/Z3/Z4-5), the 3-zone split against LT1/LTHR of the last 28 days and the thresholds used; the include_* options add detail.

compare_activitiesA

Sessions side by side: pace, GAP, HR, power (best 5/20 min if curve stored), EF, decoupling, IF, TSS, % Z4-5, cadence and running dynamics, temperature, dew point. ids compares those activities; similar_to adds stored sessions like it (same type, duration and pace/GAP within tolerance; optionally same_route, easy_only), newest first with match. Pass exactly one of ids or similar_to, otherwise it returns an error; the similar_to filters combine. For one activity in depth use get_activity. E.g. today vs usual easy runs, progress on a route: {"similar_to":23011268235,"same_route":true}.

get_readinessA

Morning GO/MODIFY/REST decision from HRV, resting HR, sleep hours and load against your own baselines. Returns each signal with its value, reference and rating (ok, yellow, red; unknown when data is missing), rules_used and a recommendation that starts with the signals that decided. Garmin's own scores (Training Readiness, Body Battery, stress; sleep score in the sleep value) are shown as info, not counted. REST needs a red pair, a single red or 2 yellow give MODIFY; rules changes the thresholds and the decision rule. Use for "how am I today" or "can I do a hard session".

get_thresholdsA

Thresholds the analytics use on date (default today): per param its value, the date it applies since and its source (garmin-auto from the Garmin profile and its LTHR, threshold pace and FTP history; test, manual, import), by_sport (run, bike, swim: LTHR and LT1 with a note when a fallback, default or approximation), HRmax and the 28-day resting HR. zones has the HR and power zone floors per sport from the Garmin profile (method, HRmax/rest/LTHR or FTP used, fetched date; current, not historical). estimates.ftp_w: 95 % of best stored 20 min ride power, not saved. history adds every recorded row. Use it to see what get_load and get_readiness compute with; record a new test result with set_threshold. Example: {"param":"lthr_run","history":true}.

set_thresholdA

Record a field test result (LTHR, LT1, HRmax, FTP…) effective from a date; ask the user before saving. Stored in the local database only, never sent to Garmin; a row with the same date, param and source stays as it is (added false). A backdated row recomputes earlier activities from its date on. Returns the row and the value in effect today. Example: {"date":"2026-10-11","param":"lthr_run","value":171,"note":"30 min TT"}.

Prompts

Interactive templates invoked by user choice

NameDescription
weekly_reviewReview a training week and ask how it felt
plan_next_weekPropose next week of training and create the workouts on request
sleep_reportSleep over a range of nights, then the worst night hour by hour
activity_reviewReview one activity and compare it with similar sessions
race_checkHow ready I am for the next race: form, predictions and the days left

Resources

Contextual data attached and managed by the client

NameDescription
profileUser profile: name, units, time zone, VO2max, HR and power zones
gearGear list with distances
devicesGarmin devices, last sync and settings
activity-typesGarmin activity type keys (e.g. running, trail_running, lap_swimming) with their parent type: the values get_activities `type` filters by and update_activity `type` accepts. Comes from the reference sync.
coursesCourses saved in Garmin Connect, newest first: id, name, sport, distance and elevation gain. Downloaded when read (auto fetch) and kept for an hour.
challengesBadges and challenges: how many badges you earned and the 10 latest, and the badge challenges you joined that are in progress, with progress in % (value and target in Garmin's unit). Downloaded when read (auto fetch) and kept for an hour.
sync-statusRecent sync runs, date coverage and record counts of the local cache
todayToday at a glance from the local cache, nothing downloaded: the readiness decision (GO/MODIFY/REST) with each signal's rating, last night in one line and the workouts planned for today

TDQS

A4.1/5.0

Scored across 21 tools

Disambiguation3/5

Most tools are cleanly separable (get_activity vs get_activities, get_workout vs list_workouts, get_gear vs get_devices), but the analytics cluster is crowded: get_load, get_training_status, get_readiness and get_period_summary all return fitness/fatigue/load data, and get_load vs get_training_status both produce CTL/ATL/TSB, differing only in which model computes them. The descriptions do heavy lifting to explain the split, but an agent can easily misselect between the 'own TSS model' and 'Garmin EPOC model' tools.

Naming Consistency4/5

Nearly all tools follow a verb_noun convention (get_sleep, create_workout, set_threshold, compare_activities, schedule_workouts), with clear domains. The main deviations are garmin_sync (server-prefixed, no noun object) and the compound download_activity_file, which break the pattern slightly but remain readable.

Tool Count3/5

21 tools is at the heavy end for a single-account fitness server; the surface is broad (activities, sleep, health, workouts, gear, devices, load, thresholds) so most tools earn their place, but several read-only analytics tools could plausibly be merged. It sits in the 16-25 'feels heavy' band rather than being obviously over-scoped.

Completeness4/5

Coverage is broad: read/write for activities, workout create/schedule/read, sleep, health metrics, body composition, gear, devices, training analytics and threshold management, with a sync and file export path. Minor gaps remain — no delete_workout from the library, no way to delete an activity or update body composition/gear, and no calendar/race creation — but core lifecycle workflows are workable.

Maintenance

ActivityMaintained
ResponsivenessLimited data