Create activity
create_activityCreate a new planned or completed workout activity for the authenticated user. Top-level distance is in METERS (8 km = 8000, a marathon = 42195) and duration is in SECONDS (45 min = 2700) — convert from whatever units the user speaks in. Always set load on planned workouts: without it the session is invisible to fitness, fatigue and 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). After creating or moving planned work, call get_training_status with no from/to and read series (the next week of load) and projection (its peak). Do not pass a long from/to for this. Above 1.5 is High. For structured interval workouts, set target to "steps" and provide steps. Write a set of N reps as ONE repeat step (stepType "repeat", numberOfIterations N, workoutSteps = the rep and its recovery), never as N copies written out: copies drift, and "6x400m" comes back as seven. Pace step targets (targetValueOne/Two) MUST be seconds-per-km (240 = 4:00/km; smaller = faster), never min/km strings or meters-per-second, or pace will not export to the user's watch. This includes SWIMMING, which athletes speak in per-100m: convert it, so "2:00 per 100m" is 1200, never 120. Do not create an activity for a rest day: rest is the absence of a workout, and a "Rest Day" row typed as a run with zero distance clutters the calendar and the training log. Skip those days entirely. date is the calendar day (YYYY-MM-DD) and never a timestamp; put time of day in startTime as local HH:mm, since Shape stores no timezone and a UTC instant cannot say what "7am" meant to the athlete. SWIM STEPS: the watch reads swimDrill, swimEquipment and swimStroke, never displayName. Set swimDrill on every drill ('drill'), kick ('kick') and pull ('pull') step, which keeps its normal stepType (usually 'interval'; 'drill' is never a stepType), swimEquipment to the one piece of kit that step uses, and swimStroke on every step whose stroke is named. When the athlete names their pool ("50m pool", "25 yard pool"), set poolLength. STRENGTH: write lifting, circuits and Hyrox as exercises, never as steps: items {type 'exercise', exercise, sets: one entry per set with reps and weightKg in kg, so 3x8 is three entries} and {type 'cardio', sport ('run', 'bike', 'skierg' or 'row'), distanceM or durationSec} for the runs and ergs between stations. Set sportType 'strength'. YOGA, pilates and mobility routines with named moves are exercises too, with sportType 'yoga': one exercise item per move, its sets time only (durationSec: cat-cow 2 min is one set of 120, 2x30s is two sets of 30, 1 min each side is two sets of 60), a move done on each side one set per side with 'each side' in notes, no reps or weight. Only exercises or moves the athlete named, never invented ones: "Strength 45 min" or "30 min yoga" is the duration with no exercises. Keep duration when there are exercises. An activity has exercises or steps, never both. On a planned activity exercises is the plan; on a completed one, what was done.
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>",
"title": "<title>",
"sportType": "<sportType>"
},
"name": "create_activity"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | Calendar day as YYYY-MM-DD. A date, never a timestamp: no time, no 'Z', no UTC offset. Time of day goes in startTime. | |
| load | No | Training 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. | |
| power | No | Average power in watts. | |
| speed | No | Average speed in meters per second. | |
| steps | No | ||
| title | Yes | ||
| target | No | What the workout is built around: "distance" when only a distance is given, "time" when only a duration, "pace" when both, "steps" for structured intervals. Set the matching distance/duration fields too — target alone carries no values. | |
| distance | No | Total distance in METERS (8 km = 8000). Never kilometers or miles — convert first. | |
| duration | No | Total duration in SECONDS (45 min = 2700, 4 hours = 14400). Never minutes. | |
| completed | No | ||
| exercises | No | ||
| heartRate | No | Average heart rate in beats per minute. | |
| sportType | Yes | ||
| startTime | No | Local 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. | |
| orderOnDay | No | ||
| poolLength | No | Set this whenever the athlete names the pool size of a swim: "in a 25 yard pool" or short course yards = "25yd", "50m pool" or long course = "50m", "25m pool" or short course meters = "25m", "33m pool" = "33m", "20m pool" = "20m", "any" = no pool size. It is sent to their Garmin watch, which counts lengths with it. Omit only when no pool is mentioned: their saved pool from settings is used instead. | |
| description | No | ||
| elevationGain | No | Total elevation gain in METERS. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| activity | Yes | Recorded fields (calories, elapsedTime, maxima, cadence, running dynamics, extras...) are left out when the source reported none: never estimated, never zero. |