Skip to main content
Glama

get_activity_segments

Read-only

Split one Garmin activity into climb, flat, and descent segments to analyze heart rate, pace, cadence, and respiration response within each part of the session.

Instructions

Split one activity into climb, flat and descent segments and report how heart rate, pace, cadence and respiration responded in each.

Use only when the user asks to analyse a specific activity in detail (e.g. heart-rate response to climbs, pace or cadence within a session). Do not use for general health, recovery or trend questions.

Per segment: distances, elapsed times, elevation gain/loss, average grade, average HR, HR at the start, peak HR and the lag from segment start to that peak (HR trails effort by tens of seconds, so peaks are searched up to 90 s past a climb's end), the HR drop in the 60 s after a climb, speed/pace, cadence, and respiration when recorded. Also returns cardiac drift (aerobic decoupling) on flat, steadily paced sections, or why it was skipped, and the HR-vs-grade slope with its lag and point count. Activities without distance or elevation (indoor) return no segments, with the reason in availability. No GPS is used.

Requires saved local Garmin authentication (garmin-owl-auth). Reads Garmin and may update the local cache; never changes your Garmin account. Garmin failures are not retried automatically.

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": {
      "activity_id": "<activity_id>"
    },
    "name": "get_activity_segments"
  }
}

Input Schema

NameRequiredDescriptionDefault
activity_idYesPositive Garmin activity ID from get_activities or get_recent_activities.
min_climb_mNoSmallest elevation change in metres that counts as a climb or descent, 1-200; defaults to 5. Smaller undulations are part of flat segments.

Output Schema

NameRequiredDescriptionDefault
samplingYes
segmentsNo
segmenterYesdistance_elevation: climb/flat/descent from the smoothed elevation profile over distance.
start_timeNoActivity start: ISO 8601 with an explicit UTC offset, e.g. 2026-10-09T23:18:16+02:00. The wall time is already local; never add the offset again. The offset is the one Garmin recorded for the device at that moment, or this computer's time zone when Garmin gives only UTC.
activity_idYes
hr_vs_gradeNo
min_climb_mYes
availabilityNo
activity_typeNo
cardiac_driftNo
segment_countYes
segments_totalNoPresent when more segments exist than are listed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.0

TDQS

A4.4/5.0
Behavior5/5

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

Beyond readOnlyHint/destructiveHint it discloses the auth dependency (saved local Garmin authentication), the side effect of updating the local cache, the assurance that the Garmin account is never modified, and that failures are not retried. It also explains analytical behaviour the agent needs to interpret results, such as HR lag and the 90 s peak search window.

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 front-loaded with purpose, then usage, then a dense block of return details, with no filler or marketing language. The per-segment field list is long and partly duplicates what the output schema already declares, which is a mild redundancy.

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?

With two well-specified parameters, full annotations and an output schema, the description covers everything an agent needs: scope, exclusions, auth prerequisites, cache side effects, no-retry failure behaviour, and the degenerate indoor case with its explanation in availability.

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

Parameters3/5

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

Schema coverage is 100%, so activity_id and min_climb_m are already fully documented, and the baseline of 3 applies. The description reinforces the single-activity and segmentation framing but does not add meaning about the climb threshold or how changing it alters segmentation.

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

Purpose5/5

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

The opening sentence gives a specific verb and resource: it splits a single activity into climb/flat/descent segments and reports HR, pace, cadence and respiration per segment. That is clearly distinct from sibling tools like get_activity, get_activity_timeseries and compare_activity_segments, which do not produce segmented per-climb metrics.

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 states an explicit when condition (the user asks to analyse a specific activity in detail, e.g. HR response to climbs) and an explicit when-not (general health, recovery or trend questions), plus the indoor/no-distance edge case. It does not name the closest sibling, compare_activity_segments, so an agent must infer that comparison across activities belongs elsewhere.

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