<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: garmlink</title>
    <description>The latest articles on DEV Community by garmlink (@garmlink_ai).</description>
    <link>https://dev.to/garmlink_ai</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4284615%2F80394097-12ba-451c-9a65-827ab7abe46c.png</url>
      <title>DEV Community: garmlink</title>
      <link>https://dev.to/garmlink_ai</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/garmlink_ai"/>
    <language>en</language>
    <item>
      <title>Asking an AI assistant about training load and HRV without fooling yourself</title>
      <dc:creator>garmlink</dc:creator>
      <pubDate>Sat, 05 Dec 2026 17:55:58 +0000</pubDate>
      <link>https://dev.to/garmlink_ai/asking-an-ai-assistant-about-training-load-and-hrv-without-fooling-yourself-21oo</link>
      <guid>https://dev.to/garmlink_ai/asking-an-ai-assistant-about-training-load-and-hrv-without-fooling-yourself-21oo</guid>
      <description>&lt;p&gt;Once an assistant can read your sleep, heart rate variability (HRV) and training load, it will happily answer any question you put to it. That is the problem. A fluent answer built on a misread number feels exactly like a good one. These are the traps I see most often, and how to phrase questions that avoid them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trap 1: one night is noise
&lt;/h2&gt;

&lt;p&gt;Overnight HRV moves with alcohol, a late meal, a hard session, a cold coming on, a bad night's sleep. A single low value tells you almost nothing. A week that sits clearly below your own usual range tells you something. So ask about windows, never about a night:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Compare my overnight HRV average for the last 7 days with my 28-day median. List the nights you used.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here is the same idea in a few lines of pandas, so you can check what the assistant claims:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;pandas&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;

&lt;span class="n"&gt;hrv&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_index&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"date"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"overnight_hrv"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sort_index&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;baseline&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;hrv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;rolling&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;28&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;min_periods&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;median&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;recent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;hrv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;rolling&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;min_periods&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;mean&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;below&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;recent&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;baseline&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mf"&gt;0.9&lt;/span&gt;   &lt;span class="c1"&gt;# illustrative threshold, not a medical one&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;below&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;min_periods&lt;/code&gt; arguments matter. Which brings us to the next trap.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trap 2: missing data is not zero
&lt;/h2&gt;

&lt;p&gt;If you skipped the watch for three nights, a careless average treats them as missing, or worse, as zero. Ask the assistant to state how many days it actually had and which ones were absent. A good answer begins with "I found 24 of 28 nights", not with a conclusion.&lt;/p&gt;

&lt;h2&gt;
  
  
  Trap 3: compare yourself to yourself
&lt;/h2&gt;

&lt;p&gt;HRV values depend on the device, the algorithm and the person. A number that looks low on a forum thread can be perfectly normal for you. Never ask "is 48 ms good?". Ask "how does this week compare with my own range over the last two months?".&lt;/p&gt;

&lt;h2&gt;
  
  
  Trap 4: load ratios are heuristics
&lt;/h2&gt;

&lt;p&gt;Many tools show a ratio between recent load (say 7 days) and longer-term load (say 28 days). It is a convenient summary, not a threshold with a proven meaning, and research on such ratios is debated. Ask for the weekly numbers behind it:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Show my training load per week for the last 8 weeks and say which week jumped most from the previous one.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Trap 5: correlation passes for cause
&lt;/h2&gt;

&lt;p&gt;"Your sleep got worse because of your training" is a story, not a result. Sleep also changes with travel, work, light, heat and evening screens. Ask for competing explanations:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;My sleep duration dropped over the last three weeks. Give me three possible reasons that my data could support or contradict, and what I should check for each.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Trap 6: sleep stages are estimates
&lt;/h2&gt;

&lt;p&gt;Wrist sensors estimate light, deep and REM sleep. Duration and regularity are far more reliable than minutes per stage. Weight your questions accordingly.&lt;/p&gt;

&lt;h2&gt;
  
  
  A habit that fixes most of this
&lt;/h2&gt;

&lt;p&gt;End every question with: "List the dates and values you used, and say how confident you are." If the answer cannot be checked against your own dashboard, do not act on it. None of this is medical advice; unusual symptoms belong with a professional.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where garmlink fits
&lt;/h2&gt;

&lt;p&gt;For Garmin users, &lt;a href="https://garmlink.ai" rel="noopener noreferrer"&gt;garmlink&lt;/a&gt; is a free, read-only MCP server that lets an assistant read your own activities, sleep, HRV and load. It is my own project, independent of Garmin. The traps above apply with any data source, though, and even with a plain CSV export.&lt;/p&gt;

&lt;p&gt;Sébastien from garmlink&lt;/p&gt;

</description>
      <category>ai</category>
      <category>health</category>
      <category>python</category>
      <category>data</category>
    </item>
    <item>
      <title>Building a read-only remote MCP server for health data: OAuth, tools and limits</title>
      <dc:creator>garmlink</dc:creator>
      <pubDate>Sat, 05 Dec 2026 12:01:49 +0000</pubDate>
      <link>https://dev.to/garmlink_ai/building-a-read-only-remote-mcp-server-for-health-data-oauth-tools-and-limits-3f17</link>
      <guid>https://dev.to/garmlink_ai/building-a-read-only-remote-mcp-server-for-health-data-oauth-tools-and-limits-3f17</guid>
      <description>&lt;p&gt;Health data is data you want an assistant to read and never to change. That makes it a good case study for the Model Context Protocol (MCP): you can design a server where "read-only" is a property of the architecture, not a sentence in the docs. Here is how the pieces fit together, and where the limits are.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why remote, not local
&lt;/h2&gt;

&lt;p&gt;A local MCP server runs on your machine and talks over stdio. It is simple, but every user must install and secure it, and it does not work from a phone or a browser-based assistant. A remote server speaks MCP over HTTP (the Streamable HTTP transport), so the assistant just connects to a URL and the user installs nothing. The cost moves to the author, who now holds credentials and has to protect them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Authorization: OAuth, not keys pasted into a chat
&lt;/h2&gt;

&lt;p&gt;A remote server must know which person is calling. The MCP specification builds on OAuth 2.1, so an assistant can run an authorization-code flow with PKCE:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The client calls your endpoint without a token and receives a 401 that points to the protected resource metadata (RFC 9728).&lt;/li&gt;
&lt;li&gt;It reads your authorization server metadata (RFC 8414) and registers itself dynamically (RFC 7591), so nobody has to share a client secret by hand.&lt;/li&gt;
&lt;li&gt;The user lands on your sign-in page, approves the request, and the client receives a short-lived access token.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The consequences are good ones: tokens are per user and revocable, the assistant never sees the upstream password, and you decide what a token may do. For health data I would keep the scope list boring: one read scope, nothing else. Encrypt tokens at rest and keep their lifetime short.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tools: few, narrow, bounded
&lt;/h2&gt;

&lt;p&gt;Every tool is a function the model may call. Four rules that held up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Name tools after questions, not endpoints: sleep for a date range, activities in a period, HRV trend.&lt;/li&gt;
&lt;li&gt;Require a date range and cap it. Return a summary plus a way to ask for more, never the full dump: huge payloads make answers worse.&lt;/li&gt;
&lt;li&gt;State units and time zones in the output. "Resting heart rate: 52 bpm" is fine, "sleep: 7.2" is not.&lt;/li&gt;
&lt;li&gt;Annotate honestly. MCP lets a tool declare hints about its behavior:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"get_sleep"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Sleep sessions for a date range (90 days maximum)."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"annotations"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;"readOnlyHint"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"destructiveHint"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"idempotentHint"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;"openWorldHint"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hints are advisory: a client may use them to skip a confirmation prompt, but nothing enforces them. Real read-only behavior comes from the server: never hold a credential that can write, never expose a write tool.&lt;/p&gt;

&lt;p&gt;One subtlety: a "refresh" tool that asks your server to re-sync from the upstream source changes your own cache, not the user's account. Say so in its description instead of hiding it behind the word read-only.&lt;/p&gt;

&lt;h2&gt;
  
  
  Limits worth stating upfront
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Read-only is not harmless.&lt;/strong&gt; The model reads the data into its context, and what the assistant vendor does with conversations is outside your server's control. Tell users.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Prompt injection.&lt;/strong&gt; Text that comes from the data source, such as an activity title or a note, can contain instructions. With no write tools the damage is bounded, but treat every tool result as untrusted input.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Freshness.&lt;/strong&gt; Your server knows only what the upstream has synced. Tell the model how old the data is.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deletion.&lt;/strong&gt; If you keep synced copies, disconnecting must delete them. Test that path.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Errors.&lt;/strong&gt; Return short, plain messages the model can relay.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where I applied this
&lt;/h2&gt;

&lt;p&gt;I used these ideas in garmlink, my own project: a free hosted MCP server that connects a Garmin Connect account to assistants such as Claude and ChatGPT. It is read-only, signs in with OAuth, and is independent of Garmin (no affiliation, no endorsement). You can see the flow from the user's side at &lt;a href="https://garmlink.ai" rel="noopener noreferrer"&gt;garmlink&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Which limits would you add to the list?&lt;/p&gt;

&lt;p&gt;Sébastien from garmlink&lt;/p&gt;

</description>
      <category>mcp</category>
      <category>ai</category>
      <category>security</category>
      <category>oauth</category>
    </item>
  </channel>
</rss>
