Building a Weekly Garmin Fitness Summary Email with the Garmin Chat Desktop Connector
Because manually tracking fitness is so last week – let AI sweat the details while you just hit 'send'!
As someone who’s always pushing my limits with running, cycling, and strength training in the heart of Ohio, I love leveraging tech to keep my fitness game strong. Today, I’m excited to share how I built an automated weekly email summary of my Garmin fitness data using the Garmin Chat Desktop Connector. This setup fetches my last week’s activities, sleep, heart rate, and more, then compiles it into a slick, visually appealing HTML email that lands in my inbox (or as a draft in Gmail). It’s like having a personal fitness coach cheering you on every Monday.
The inspiration? I wanted a quick, motivational recap without logging into the Garmin app every time. Using a prompt-based agent action (think AI-driven workflows in tools like LangChain or custom automation platforms), I created this as a reusable “Task” or “Agent” that runs on a schedule. The end result is an email that looks professional and fun—check out the sample below from my March 9-16, 2026, report. It even includes emojis, color-coded stats, and a “Highlight of the Week” section.
If you’re into fitness tracking and automation, this is a game-changer. Let’s dive into how to build it.
Prerequisites
Before we start, you’ll need:
A Garmin Connect account with activity data.
The Garmin Chat Desktop Connector installed.
Gmail account for sending emails (we’ll use Gmail’s API tools via the connector).
An automation platform or script environment that supports agent actions (e.g., Python with LangChain, or a no-code tool like Zapier/Make.com that can integrate custom prompts).
Basic knowledge of HTML/CSS for the email template (but don’t worry, the prompt handles most of it).
The core of this is a structured prompt that defines the agent’s steps. I’ll walk through it, explaining how to implement each part as a Task/Agent action.
The Core Prompt: Defining the Agent’s Workflow
I designed this as a sequential agent action, where the “agent” is an AI model (like Grok or GPT) that calls tools in parallel and processes data. The prompt ensures everything runs smoothly, even if some data is missing. Here’s how it breaks down:
Step 1: Determine the Date Range
Start simple: Use the current date to calculate the last 7 days.
end_date = Today’s date (e.g., 2026-03-16).
start_date = 7 days prior (e.g., 2026-03-09).
In your agent setup, pull the current date from the system context or a date tool. This keeps it dynamic—no hardcoding needed.
Step 2: Fetch Garmin Data
This is where the Garmin Chat Desktop Connector shines. It exposes MCP (Message Control Protocol) tools for API calls. In the agent, call these in parallel to avoid delays:
get_activities_by_date_range — Grabs all workouts between start and end dates.
get_sleep_summary — Loop over each of the 7 days (or use a range if the API supports it).
get_heart_rate — Latest resting HR.
get_stress_summary — Weekly average.
get_body_battery — Recent readings.
get_hrv_status — Recovery insights.
get_training_readiness — Current score.
get_today_summary — Daily overview.
Configure the connector to authenticate with your Garmin account. In code or a no-code platform, these become function calls. Handle empties gracefully—e.g., if no sleep data, note it later.
Step 3: Analyze and Generate Kudos
Now the fun part: Process the data for insights.
Tally totals: Activities by type (e.g., 16 runs, 6 strength sessions), distance (38.1 km), time (5 hrs 40 min), calories (3,267).
Pick a “best” activity: Like my 5.18 km outdoor run on March 9 with 173 bpm avg HR and 360 calories—labeled as high training load impacting aerobic fitness.
Sleep/recovery: Avg 7.8 hrs, score 83/100; HRV 37 ms.
Kudos: Generate 2-3 lines like “You crushed it with 22 sessions!” based on performance.
Use simple logic in the agent: If activities > 10, add “elite consistency” praise. This makes it feel personal.
Step 4: Build the HTML Email
The agent constructs a self-contained HTML string with inline CSS. No external links—everything’s embedded for reliability. Key elements:
Header: Dark gradient (#1a1a2e to #16213e), trophy emoji 🏅, title, and date range.
Kudos Card: Green background (#e8f5e9), headline like “Beast Mode Activated!”, plus motivations.
Stats Table: Alternating rows, metrics like Total Workouts (22), Distance (-38.1 km—wait, that might be a delta; adjust for positives), with vs. last week if you extend the agent.
Activity Log Table: Rows per session, with emojis (🏃 for run, 💪 for strength), color badges (blue for run, purple for strength).
Sleep & Recovery: Side-by-side cards—bar graphs for sleep scores (green for good), gauges for recovery (e.g., Training Readiness: 15/100 - Poor, in red #f44336).
Highlight Card: Gold border for the week’s star activity, full stats.
Footer: Dark bg, small text with a quote like “The secret of getting ahead is getting started.”
Cap width at 600px for mobile. Use colors consistently: Cyan-blue #00b4d8 for accents, green #4caf50 for success. Emojis add flair without overwhelming.
In the agent, build this as a template string, injecting data via placeholders.
Step 5: Send the Email via Gmail
Finally, integrate Gmail tools:
Call gmail_get_profile to get your email.
Set To: Your own address (self-send for review).
Subject: 🏃 Your Weekly Garmin Summary — Mar 9-16.
Body: The HTML.
Use gmail_create_draft (safer than direct send; review before sending).
If send fails, it drafts automatically. Configure OAuth in the connector for seamless auth.
Getting Started with the Garmin Chat Connector
For detailed setup and implementation, check out my full guide on the Garmin Chat Connector at https://rodtrent.substack.com/p/its-official-garmin-chat-connector. It covers installation, authentication, and how to integrate with AI models.
To configure this as a Task or Agent:
For Claude (Anthropic): Use the Claude API or Opus model in a workflow tool like LangChain. Paste the prompt into a custom agent chain, mapping Garmin tools to function calls. Schedule via AWS Lambda or similar for weekly runs.
For ChatGPT (OpenAI): In the GPT-4 or later interface, create a custom GPT with actions. Define the schema for Garmin MCP tools in the Actions section, then use the prompt as the system instruction. Trigger it manually or via Zapier for automation.
In my test run for March 9-16, 2026, it highlighted my Butler County run as the peak, with solid sleep but room for recovery improvement. The email’s visual breakdown (bars, tables, icons) made reviewing effortless.
Why This Rocks (and Next Steps)
This automation saves time, boosts motivation, and turns raw data into actionable insights. No more forgetting to check Garmin—it’s in your inbox, looking sharp.
Want to level up? Add comparisons to previous weeks, integrate weather data for outdoor runs, or even attach charts. If you’re building similar agents, share your twists in the comments!
Generated from my Garmin Connect data, inspired by Mark Twain: “The secret of getting ahead is getting started.” Keep moving, folks!
## Weekly Garmin Activity Summary Email
Your objective is to fetch the last 7 days of Garmin health and fitness data, compile it into a beautiful HTML email, and send it via Gmail.
---
### Step 1: Determine Date Range
Today's date is available via the `currentDate` context. Compute:
- `end_date` = today's date (YYYY-MM-DD)
- `start_date` = 7 days ago (YYYY-MM-DD)
---
### Step 2: Fetch Garmin Data
Call ALL of the following Garmin MCP tools in parallel:
1. `get_activities_by_date_range` — with `start_date` and `end_date`
2. `get_sleep_summary` — for each of the last 7 days (or a date range if supported)
3. `get_heart_rate` — for today or the most recent day
4. `get_stress_summary` — for the week
5. `get_body_battery` — for the most recent available data
6. `get_hrv_status` — HRV/recovery status
7. `get_training_readiness` — current training readiness score
8. `get_today_summary` — overall today summary
Collect all results. Note any days with missing data.
---
### Step 3: Analyze & Generate Kudos
From the collected data, identify:
- **Total activities** this week and breakdown by type (run, bike, swim, strength, etc.)
- **Total distance** (km or miles), **total duration**, **total calories**
- **Best activity** of the week (longest, fastest, highest HR, most calories — pick the most impressive)
- **Sleep highlights**: best sleep score, average sleep duration
- **Stress/recovery**: average stress, best body battery reading
- **Personal achievements**: any activity that stands out (e.g., longest run, best pace, new distance PR)
- **Motivational kudos**: 2–3 personalized encouraging sentences based on the week's performance (e.g., "Crushed it with 5 workouts!" or "Great consistency — you showed up every day!")
---
### Step 4: Build the HTML Email
Construct a fully self-contained HTML email string with inline CSS (no external stylesheets). Use the following structure:
```
Subject: 🏃 Your Weekly Garmin Summary — [date range, e.g. Mar 9–15]
```
**Email layout:**
1. **Header banner** — dark gradient background (#1a1a2e → #16213e), white text, Garmin logo emoji 🏅, title "Your Weekly Fitness Report", and the date range.
2. **Kudos card** — light green/teal background (#e8f5e9), bold kudos headline (e.g., "🎉 Great week!"), followed by the personalized motivational sentences.
3. **Weekly Stats Summary table** — clean table with alternating row colors (#f9f9f9 / white), columns: Metric | Value | vs Last Week (if available). Include:
- Total Workouts
- Total Distance
- Total Duration
- Total Calories Burned
- Avg Resting Heart Rate
- Avg Sleep Duration
- Avg Stress Level
- Best Body Battery
4. **Activity Log table** — one row per activity with columns: Date | Type | Duration | Distance | Avg HR | Calories. Use color-coded Type badges (e.g., 🏃 Run = blue, 🚴 Bike = orange, 🏊 Swim = teal, 💪 Strength = purple). Use emoji icons for activity types.
5. **Sleep & Recovery section** — a 2-column section (side by side cards):
- Left card: Sleep summary with a simple bar representation of sleep score per night (use colored div blocks scaled to score, e.g., score 85 = wide green bar)
- Right card: Body battery / HRV / training readiness gauge description
6. **Highlight of the Week** — a featured card with a gold/yellow border highlighting the single best activity with its full stats.
7. **Footer** — dark background, small text: "Generated from your Garmin Connect data • Weekly Fitness Summary" with a small motivational quote.
Use these color constants throughout:
- Primary: #00b4d8 (cyan-blue)
- Success/good: #4caf50 (green)
- Warning/moderate: #ff9800 (orange)
- Danger/high: #f44336 (red)
- Dark bg: #1a1a2e
- Font: Arial, sans-serif
Make the email mobile-friendly with max-width: 600px, centered.
---
### Step 5: Send the Email via Gmail
1. Use `gmail_get_profile` to get the authenticated user's email address.
2. Construct the email:
- **To**: the user's own Gmail address (send it to themselves)
- **Subject**: `🏃 Your Weekly Garmin Summary — [start_date_formatted] to [end_date_formatted]`
- **Body**: the full HTML string from Step 4
3. Use `gmail_create_draft` to create the draft with the HTML content.
**Important:** When calling `gmail_create_draft`, set the body as HTML content.
---
### Success Criteria
- All available Garmin data for the past 7 days has been fetched
- A visually rich HTML email has been composed with tables, color coding, and emoji
- The email has been created as a Gmail draft (or sent if the send tool is available)
- The task completes without errors; if any Garmin tool returns no data, gracefully omit that section rather than failing
---
### Error Handling
- If a Garmin tool fails or returns empty data, skip that section and note it in the email footer as "Data unavailable for: [section]"
- If Gmail send fails, fall back to `gmail_create_draft`
- Always complete and send/draft the email even if some data sections are missing



