Skip to main content
Glama
io.github.matisdsp/fartlek

io.github.matisdsp/fartlek

by matisdsp

Fartlek

A coach's morning report from your Garmin data, for any LLM via MCP.

Every other Garmin MCP server hands the LLM a filing cabinet of raw JSON: one night of sleep is ~52K tokens, one activity stream ~155K. The model can't read it, so it skims and improvises. Fartlek does the synthesis server-side: computed sports-science metrics (CTL/ATL/TSB, ACWR, monotony, calibrated training load), personal baselines with significance floors, safety alerts, delivered as compact, verdict-first reports the model can actually reason about.

The token contract: calling every tool in the catalog once, at default arguments, costs under 17K tokens, about a third of one raw Garmin sleep payload (the sum of the caps below is 16,970; tests/test_guardrails.py fails above 17,000). Without garmin_raw and garmin_reference the sum is 9,970. Hard caps are enforced per response by the renderer, with disclosed truncation, and tests/test_budget_gate.py counts golden renders with a real tokenizer.

The tools

Caps are in tokens, as set in the code (CAP constants in fartlek/mcp_server/tools/).

Tool

What it answers

Cap

garmin_brief

"How am I today, can I train hard?" Fused GREEN/AMBER/RED verdict vs your own baselines

600

garmin_activities

Browse the log, get activity IDs

1,300

garmin_activity

One session in depth: reps, fade, comparison to your most similar past session (detail standard, splits, full)

1,000 / 2,000 / 4,000

garmin_athlete

Reference card: zones, PRs, goal, data coverage

600

garmin_gear

Shoe and bike mileage vs the retirement limits you set in Garmin Connect, and what you actually rotate

500

garmin_set_profile

Tell it your goal race, phase and availability (local only)

200

garmin_log

Log RPE, wellness, illness or injury; the athlete outranks the sensors

120

garmin_sync

Re-read the export, or deepen history

150

garmin_setup

Is the server configured, and what is missing; starts with the export

400

garmin_recovery

Sleep, HRV, resting HR and load structure vs baselines, plus the overtraining audit

1,100

garmin_load

Multi-week load: CTL/ATL/TSB, ramp, ACWR, monotony, intensity drift

1,100

garmin_fitness

VO2max and efficiency trends, race projection against your goal, taper guidance

1,000

garmin_week

One week in session-level detail, with load vs recent weeks

1,200

garmin_whats_changed

Only the statistically significant changes of the last N days

700

garmin_reference

How a number was computed, and whether to trust it

2,000 per topic

garmin_raw

Bounded, compacted escape hatch to named raw sources

5,000

Related MCP server: claude-garmin

Quickstart

pipx install fartlek-mcp        # or: uv tool install fartlek-mcp
  1. In your Garmin account, open Data Management > Export Your Data and request the export. Garmin emails you a download link. It says this usually takes about 48 hours and can take up to 30 days.

  2. Import the zip. Nothing connects to Garmin and no credentials are involved:

fartlek import ~/Downloads/<your-export>.zip
  1. Point your MCP client at the server. Claude Code:

claude mcp add fartlek -- fartlek-mcp

Any other MCP client: add a stdio server whose command is fartlek-mcp.

The report stops at the day of the export. Importing a newer export updates the store. Your own settings and log entries are kept.

What the export does not contain

Compared on one real account against the Connect API, over 530 activities and 356 days: activities, laps, overnight HRV and sleep scores are identical after converting units, and daily totals match on 99 % of days or more. A one-account check is not a guarantee for other devices. The export lacks:

Missing

Effect

Per-minute sleep stages

Sleep regularity index unavailable

Garmin's nightly sleep need

Sleep debt uses 8 h, or the need you set

HRV status and weekly average

Not shown; Fartlek's own HRV band does not use them

Grade-adjusted speed per lap

Efficiency and decoupling use plain speed

Model names of unrenamed gear

Gear may appear under its brand only

Raw detail per session

garmin_raw and garmin_activity detail=full have nothing to return

CLI

Command

What it does

fartlek import <zip>

fill the local store from a Garmin account export (--since YYYY-MM-DD limits how far back)

fartlek accounts

list local accounts

fartlek export [dir]

export the store (SQLite snapshot and one CSV per table)

fartlek reset

wipe all local data (asks confirmation)

FARTLEK_HOME sets the data directory (default ~/.fartlek). The Dockerfile builds the same server: mount a data volume on /data.

Privacy and Garmin's terms

Stdio transport, local SQLite store: your health data stays on your machine, and importing an export contacts nobody. The code also contains a direct connection to Garmin Connect. It is off by default and unsupported: it reads endpoints Garmin does not publish for third parties, which Garmin's Terms of Use do not allow, and Garmin can suspend accounts for automated access.

License & trademark

Apache 2.0. Fartlek is an independent open-source project, not affiliated with, endorsed by, or sponsored by Garmin Ltd. "Garmin" is used only to describe compatibility with Garmin Connect data.

Available Tools

14 tools
garmin_activitiesA
Read-only

Browse the log and get activity IDs. One row per session, each carrying the activity_id garmin_activity accepts. Filter by date range and sport; truncation is disclosed with narrowing advice.

Inputs: limit, sport, end_date, start_date. Returns: result

garmin_activityA
Read-only

ONE session in depth: execution vs structure, rep-by-rep fade, decoupling, comparison to the closest past session, planned-vs-executed. Select by activity_id, by date, or omit both for the latest — add sport for the latest of that sport. 'splits' adds the lap table; 'full' adds an HR/pace curve.

Inputs: date, sport, detail, activity_id. Returns: result

garmin_athleteA
Read-only

Reference card: zones, thresholds, PRs, goal and phase, baselines, injury notes, device data coverage. Call once when athlete context is unknown; it changes rarely. To change it, garmin_set_profile.

Inputs: no named parameters. Returns: result

garmin_briefA
Read-only

Call FIRST for anything about TODAY: readiness, whether to train, current state. Zero arguments. Returns a fused go/modify/rest verdict against personal baselines, active alerts, yesterday's session with its activity_id, and today's planned workout. One session → garmin_activity; browsing → garmin_activities.

Inputs: date. Returns: result

garmin_fitnessA
Read-only

Is training working: VO2max and efficiency trends, HR at a fixed pace, long-run durability, a race projection against the stored goal, and form projected to race day with taper guidance. Call for 'am I getting fitter', race planning, taper timing, goal feasibility. Set the goal with garmin_set_profile.

Inputs: weeks, anchor_date. Returns: result

garmin_loadA
Read-only

Multi-week dose: fitness/fatigue/form (CTL/ATL/TSB), ramp rate, ACWR, monotony/strain, and intensity drift vs this athlete's own norm. Call for 'am I training too much', ramp/taper dosing, periodization. Not single-day readiness (garmin_brief); overtraining physiology is garmin_recovery.

Inputs: weeks, anchor_date. Returns: result

garmin_logA
Idempotent

Subjective data the watch cannot capture: session RPE (1-10), Hooper wellness (fatigue, soreness, stress, mood, sleep quality, each 1-7), and notes — especially illness or injury (set flag; resolve when healed). Feeds sRPE load and caps the readiness verdict. Ask for RPE after discussing a session if missing.

Inputs: rpe, date, flag, mood, +7 more. Returns: result

garmin_rawA
Read-only

Bounded escape hatch to one named Garmin source, compacted and hard-capped. Use ONLY when a synthesis tool cannot answer and the user explicitly asks for raw values. Never a starting point.

Inputs: source (required), date, series, max_points, +1 more. Returns: result

garmin_recoveryA
Read-only

Sleep, HRV, resting HR and load structure vs personal baselines, plus the multi-marker overtraining audit. Call for tiredness, sleep, 'am I overtraining or getting sick', or when another tool flags recovery. OWNS overtraining questions. Single-day go/no-go is garmin_brief.

Inputs: days, anchor_date. Returns: result

garmin_referenceA
Read-only

How a number was computed and whether to trust it: formula, inputs, whether each threshold is a population default or personally derived, and the caveats. No arguments for the index; metric='acwr' for one in depth.

Inputs: topic, metric. Returns: result

garmin_set_profileA
Idempotent

Athlete context the watch cannot know: goal race (date; a distance, or a fixed-time event like 24h with a target distance), phase, weekly availability, intensity preference, LT1 override. Local only; only provided fields change. Injuries and illness go to garmin_log.

Inputs: phase, goal_time, phase_week, tid_target, +7 more. Returns: result

garmin_syncA

Force a refresh and report freshness, or start a resumable historical backfill (backfill_days > 0, deepens sleep/HRV history). Use only if data looks stale — every other tool auto-refreshes.

Inputs: backfill_days. Returns: result

garmin_weekA
Read-only

One week in session-level detail: load vs recent weeks, intensity distribution, a per-day session table with activity_ids, recovery summary, and plan compliance where a plan exists. Call for 'how was my week' or a specific week. Multi-week trajectory is garmin_load.

Inputs: anchor_date. Returns: result

garmin_whats_changedA
Read-only

Call for 'anything I should know?', 'what's new?', 'catch me up', or after days away. Scans every tracked metric and returns ONLY statistically significant changes, ranked safety-first; says 'nothing notable' when nothing tripped. Today's readiness is garmin_brief.

Inputs: since_days. Returns: result

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 14 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose with explicit cross-references (e.g., garmin_brief owns today's readiness, garmin_recovery owns overtraining, garmin_load owns multi-week training dose). No two tools appear to do the same thing; even similar tools like garmin_activities/garmin_activity are distinguished by singular vs plural and description.

    Naming Consistency4/5

    All tools share the garmin_ prefix and lowercase snake_case, but the pattern mixes nouns (garmin_activity, garmin_week), verbs (garmin_sync), verb phrases (garmin_set_profile), and a question (garmin_whats_changed). Read vs write is somewhat predictable (nouns for queries, verbs for actions), but not uniform.

    Tool Count5/5

    14 tools is within the ideal 3-15 range and each tool covers a distinct aspect of Garmin data analysis: from daily brief to weekly summary, fitness trends, recovery, load, and raw data. The size feels justified for the domain.

    Completeness4/5

    The server covers the full workflow of an athletic coaching assistant: profile management, subjective logging, daily readiness, activity browsing and deep-dive, fitness/recovery/load analysis, week summaries, change detection, and reference/raw data escape hatches. Minor gaps exist (e.g., no direct plan editing or log deletion), but they are outside the stated purpose.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that integrates Garmin Connect data with LLMs to provide personalized running analysis and training plans. It enables users to monitor performance metrics, manage training loads, and receive data-driven workout suggestions based on health indicators like VO2 Max and recovery status.
      43
      5
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server that connects Garmin Connect data to Claude, enabling training analysis, recovery checks, and personalized plans based on real metrics like HRV, training load, and activities.
      26
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      An MCP server that gives LLMs access to Garmin Connect data, including training, recovery, sleep, stress, VO2 Max, and running summaries for personalized fitness advice.
      24
      56 PyPI
      1
      MIT