Skip to main content
Glama

Record a completed session

complete_activity

Record what the athlete did against a planned activity. Creates a completed activity paired with the plan and leaves the plan as it was, so planned and done can be compared. Use this whenever the athlete reports a session they did against a plan, even when it differs from the plan: "I did 3x8 at 62.5", "log today's session, bench 3x8 at 60", "I did the workout but only 2 sets of squats". Never update_activity for that: it overwrites the plan. A session named without a day ("the workout", "my session") is the one planned for today, not a later one that fits the words better. Send what was done: exercises with every set as performed (weightKg in KILOGRAMS), or for a run or ride its duration in SECONDS and distance in METERS. Anything left out is taken from the plan, as done as planned (a plan dated after today is recorded today); when part of the session changed, send the whole session with the change. exercises items: {type 'exercise', exercise, sets: one entry per set with reps and weightKg, or durationSec alone for a yoga move} and {type 'cardio', sport ('run', 'bike', 'skierg' or 'row'), distanceM or durationSec}. Refused when the planned activity is already paired or is not a plan. To change what is planned, use update_activity.

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": {
      "plannedActivityId": "<plannedActivityId>"
    },
    "name": "complete_activity"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateNoCalendar day as YYYY-MM-DD. A date, never a timestamp: no time, no 'Z', no UTC offset. Time of day goes in startTime.
loadNoTraining load (TSS). Set this on every planned workout — without it the session does not appear on the load chart or in get_training_status's projection. Estimate as (duration_seconds / 3600) × effort² × 100, where effort is 0.25 recovery, 0.5 easy, 0.75 tempo, 1.0 threshold, 1.25 VO2, 1.5 race. A 60-minute easy run is ~25; a 4-hour moderate ride (~0.65) is ~169. Omit only on completed activities that a device will score, or strength with no endurance load.
powerNoAverage power in watts.
speedNoAverage speed in meters per second.
titleNo
distanceNoTotal distance in METERS (8 km = 8000). Never kilometers or miles — convert first.
durationNoTotal duration in SECONDS (45 min = 2700, 4 hours = 14400). Never minutes.
exercisesNoWhat was done, every set as the athlete did it, in the same item shape as a plan's exercises. Omit when it went as planned: the plan's exercises are recorded. When only part changed (one exercise had fewer sets), send the whole session with that change.
heartRateNoAverage heart rate in beats per minute.
sportTypeNo
startTimeNoLocal wall-clock start time as HH:mm on a 24-hour clock (07:00 = 7am, 17:30 = 5:30pm), in the athlete's own time. ONLY set this when the athlete actually states a time. If they do not mention one, omit the field entirely: never infer, default, or guess a time, because an invented value turns an all-day plan into a timed event in their calendar. Never attach a timezone or offset: 07:00 means 7am where they are, and a UTC instant cannot express that.
descriptionNo
elevationGainNoTotal elevation gain in METERS.
plannedActivityIdYesThe planned activity the session was done against: today's plan when the athlete names no day. It is kept as it was, and paired with the new completed activity.

Output Schema

NameRequiredDescriptionDefault
noteNoPresent when a watch had already recorded this session: `activity` is then that recording, now carrying the session's title, plan and sets, and the session counts once.
activityYesThe new completed activity, paired with the plan.
plannedActivityIdYesThe plan, unchanged but for its pairing.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / plannedActivityId / description
      Previous value: -"The planned activity the session was done against. It is kept as it was, and paired with the new completed activity."New value: +"The planned activity the session was done against: today's plan when the athlete names no day. It is kept as it was, and paired with the new completed activity."
    • changedInput schema / properties / sportType / enum
      Previous value: -[
      -  "run",
      -  "bike",
      -  "swim",
      -  "hike",
      -  "yoga",
      -  "tennis",
      -  "golf",
      -  "soccer",
      -  "skiing",
      -  "nordicski",
      -  "skierg",
      -  "row",
      -  "kayak",
      -  "strength",
      -  "surf",
      -  "other"
      -]New value: +[
      +  "run",
      +  "bike",
      +  "swim",
      +  "hike",
      +  "yoga",
      +  "tennis",
      +  "golf",
      +  "soccer",
      +  "skiing",
      +  "nordicski",
      +  "skierg",
      +  "row",
      +  "kayak",
      +  "climb",
      +  "strength",
      +  "surf",
      +  "other"
      +]
  2. Changed1 schema field changed
    • addedOutput schema / properties / note
      Added value: +{
      +  "description": "Present when a watch had already recorded this session: `activity` is then that recording, now carrying the session's title, plan and sets, and the session counts once.",
      +  "type": "string"
      +}
  3. Changed2 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  4. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Beyond the annotations it discloses the key side effects: the plan is left untouched and paired with a new completed activity, and the call is "refused when the planned activity is already paired or is not a plan" — effectively explaining the non-idempotent behavior the idempotentHint=false flag only hints at. It also spells out the fill-forward defaults (anything omitted is taken from the plan, and a plan dated after today is recorded today), which is behavior an agent could not infer from the schema.

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?

Purpose and the update_activity exclusion are front-loaded, then usage examples, then payload shape, then the refusal condition — a sensible order. The payload paragraph is dense and repeats unit conventions the schema already documents in detail, which costs it a point, but nothing is off-topic.

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 14-parameter, non-idempotent mutation with only one required field, the description covers the side effect on the plan, the pairing precondition, default fill-forward behavior, and the shape of both exercise and cardio items. An output schema exists, so return values need not be described here.

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 79% and the schema is already verbose, but the description adds operational meaning: every set written out individually (never a repeat block), hybrid sessions written item by item rather than merged into rounds, yoga as durationSec-only moves, and the rule to resend the whole session when only part changed. Units (kg, seconds, meters) are restated from the schema, so some of this is redundant rather than additive.

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?

States a specific verb and resource ("Creates a completed activity paired with the plan") and immediately contrasts with the sibling that does the opposite thing ("Never update_activity for that: it overwrites the plan"). An agent can tell complete_activity from create_activity/update_activity without opening any schema.

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

Usage Guidelines5/5

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

Gives concrete triggering utterances ("I did 3x8 at 62.5", "log today's session, bench 3x8 at 60"), an explicit exclusion ("Never update_activity for that"), a disambiguation rule for undated sessions ("the workout" means today's plan), and a closing redirect ("To change what is planned, use update_activity"). When-to-use, when-not, and the alternative are all named.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources