Skip to main content
Glama

Record a threshold

set_threshold

Record a field test threshold such as LTHR, LT1, HRmax, or FTP with an effective date, confirm before saving locally, and recompute affected activities when backdated.

Instructions

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"}.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "date": "<date>",
      "param": "<param>",
      "value": "<value>"
    },
    "name": "set_threshold"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateYesDay of the test, not in the future
noteNoe.g. the test protocol
paramYesHeart rates in bpm, ftp_w/run_ftp_w in W, css_s_per_100m in s per 100 m, run_threshold_pace_s_per_km in s per km
valueYesIn the unit of `param`
sourceNotest: measured in a field or lab test; manual: a value the user sets without a testtest

Output Schema

NameRequiredDescriptionDefault
dataYes
metaYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.6.2
    • removedInput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / properties / note / description
      Added value: +"e.g. the test protocol"
    • addedInput schema / properties / source / description
      Added value: +"test: measured in a field or lab test; manual: a value the user sets without a test"
    • addedInput schema / properties / value / description
      Added value: +"In the unit of `param`"
  2. First observedv0.6.0

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare non-read-only, non-destructive, closed-world; the description goes far beyond that by disclosing local-only persistence ('never sent to Garmin'), upsert semantics ('a row with the same date, param and source stays as it is (added false)'), and a non-obvious side effect ('a backdated row recomputes earlier activities from its date on'). Those are exactly the consequences an agent could not infer from the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is a single dense block where every sentence carries real information: intent, confirmation requirement, storage scope, dedupe rule, backdating effect, and return value. Slightly packed — the user-confirmation instruction sits mid-sentence rather than being front-loaded — but there is no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 5-parameter mutation with an output schema, the description covers purpose, precondition (user confirmation), storage boundary, dedupe behavior, downstream side effects, and even return contents. Nothing an agent needs in order to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is already 100%, so the baseline is 3; the description adds value by giving a concrete invocation example with date, param, value and note, showing how the enum param and numeric value compose in practice. It doesn't restate units, but the schema handles those adequately.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Record a field test result (LTHR, LT1, HRmax, FTP…) effective from a date', which tells an agent exactly what the tool writes and in what domain. It doesn't name the read counterpart (get_thresholds) as a contrast, but the write semantics are unambiguous and the enumerations of supported metrics make it easy to distinguish from unrelated siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives an explicit operating instruction — 'ask the user before saving' — which is genuine when-to-use guidance for a mutation. It also implicitly scopes use to post-test recording via 'field test result' and the 'source' distinction between test and manual. It stops short of naming get_thresholds as the read alternative or stating when a backdated entry should be preferred over a fresh one.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.