edit_activity
Correct one completed activity when the recording got it wrong — its MEASURED numbers (jammed GPS, a dropped sensor, a computer left running) or the DAY it was filed on. Picking the mode is the whole job:
• create — the WHOLE session never recorded (no activity that day; the plan shows it missed) and the athlete knows its numbers ('бегал в понедельник 10 км за 52 минуты, часы не записали'). Pass id "new", date, sport (running / cycling / other), the TOTAL movingTime, and whatever else they said — distance, elevation, avgHr, maxHr, avgWatts, time, name; never estimate a number they did not give. list_activities for that day FIRST: if a recording is there, correct it instead. The row is marked entered by hand (one block, no trace, TSS only from pace or watts); revert removes it.
• extend — part of the session DIDN'T RECORD and the athlete says it was like the rest ('первые полчаса не записались, ехал так же'). Pass the new TOTAL movingTime in seconds. Volume scales, intensity is kept, and the personal bests stand. Pass distance too if they know the real total (their usual loop); otherwise it follows the duration.
• trim — the recording RAN ON after the session ended (the computer went into the car, the pocket, the walk home: 'после 1:45 запись шла в машине'). Pass endSec = the second of the recording it ended at, on the clock of get_activity_series rows — read it off the series (where the work stops), not off the athlete's watch. Everything after is cut and every number is read again from the record (work, NP, IF, TSS, zones, distance, the chart and the intervals); pass distance / elevation only if the athlete knows them better. Never correct for this.
• laps — the DISTANCE of particular laps was wrong and the athlete knows the real one: a treadmill or track run measured by a foot pod, a run power meter or the watch ('работы были по 1600 м', 'на дорожке 5×1000'). Pass laps = [{ n, m }]: n = the lap's number as the Laps table shows it (Lap 5 → 5; read them from get_activity), m = its real metres. Inside each named lap the record's distance is calibrated to those metres; time, heart rate, power and cadence stay as measured. Every lap's pace, % and zone, the total distance, pace zones, TSS, the detected intervals and the distance records are read again. Laps not named stay as measured unless the athlete says the same sensor was off throughout — then others: 'scale' gives them the named laps' factor; ask about the warm-up and the recoveries rather than assume. Never correct for this.
• correct — a recorded number is FALSE ('Страва посчитала 42 км, а я пробежал 10'). Pass the corrected absolute values; work and time-in-zone are what the stream measured and stay. Correcting the distance REMOVES this session's distance records — they were computed from the wrong track and the true splits can't be recovered — so tell the athlete that before they apply.
• move — the recording's CLOCK was wrong, not its numbers: the device filed the session on the wrong day or hour ('записалась на 22 сентября, а ехал сегодня'). Pass date, and time only if the start time was wrong too. Nothing measured changes and syncs won't move it back; Strava and intervals.icu keep their own date — say so.
• merge — ONE session that arrived as TWO activities (Zwift or a head unit restarted its recording, a watch saved mid-ride): 'объедини эти две'. Pass withId = the other half's id (both from list_activities, same sport, the second starting after the first ends, at most 3 h apart). The earlier one stays and absorbs the later (hidden): volume adds up, NP/IF/TSS recomputed, chart and intervals joined, note/RPE/tags carried. Three or more: merge two, then the result with the next. If the athlete ALSO says a stretch between them was not recorded, merge first, then extend the merged one.
• revert — undo earlier corrections, a move or a merge included, and put the provider's original back ('верни как было'); a merge comes apart again (the last one merged). No values needed.
All values are absolute NEW totals (seconds, metres), never deltas. You do NOT compute the consequences: the server recomputes them and the confirmation card shows every before→after — read it before saying what changes. Ask for whatever you're missing rather than guessing a number — and get_activity first, so you are correcting the real values. Once corrected, the session is the athlete's: syncs from Strava/intervals stop overwriting its measured fields, and it counts as corrected in the week, the load history and the Records tab.
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": {
"id": "<id>",
"mode": "<mode>",
"ask": "<ask>"
},
"name": "edit_activity"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| ask | Yes | What the athlete asked for, in THEIR words and language — stored with the edit and shown in the app as the reason this session is marked edited. | |
| date | No | `move`: the real day, YYYY-MM-DD. | |
| laps | No | `laps`: the laps whose real distance the athlete knows. | |
| mode | Yes | ||
| name | No | `create`: its title, if the athlete gave one. | |
| time | No | `move`: the real start, HH:MM (24h); omit to keep the recorded time. | |
| avgHr | No | `create`: average heart rate, if they know it. | |
| maxHr | No | `create`: maximum heart rate, if they know it. | |
| sport | No | `create`: what the session was. | |
| endSec | No | `trim`: the second of the recording the session ended at (get_activity_series' clock). | |
| others | No | `laps`: laps not named stay as measured (keep, the default) or take the named laps' sensor factor (scale) — only when the athlete says so. | |
| withId | No | `merge`: the id of the OTHER activity of the same session. | |
| avgWatts | No | `create`, a ride: average power, if they know it. | |
| distance | No | New total distance in METRES. | |
| elevation | No | New total elevation gain in metres. | |
| movingTime | No | New TOTAL moving time in seconds (not a delta). | |
| elapsedTime | No | New total elapsed/wall-clock seconds. Usually omit — it follows movingTime. |