Archive workouts to local files (writes nothing at Suunto)
archive_workoutsCopies the user's workouts to local files so the history does not depend on how far back Suunto's list reaches: per workout .fit (the FIT file as Suunto sent it) and .json (the workout's summary from the list with…
Instructions
Copies the user's workouts to local files so the history does not depend on how far back Suunto's list reaches: per workout .fit (the FIT file as Suunto sent it) and .json (the workout's summary from the list with its summary and intensity extensions, the FIT's size and SHA-256) in ~/.suunto-mcp/archive/ (SUUNTO_ARCHIVE_DIR moves it; files are 0600 and a folder the tool creates is 0700, an existing folder keeps its mode; each file is written complete under a temporary name and linked into place, which fails if the name exists, so not even another process can overwrite one: the folder's filesystem must support hard links). Incremental: a workout whose record exists is skipped, at most limit FIT files are downloaded per call (1-20, default 20, newest workouts first), and the result's remaining says how many are still missing: CALL AGAIN until remaining is 0, unless a note says it will not help (failed downloads are listed in errors and tried after the others next time). Each FIT file is checked before its record is written (non-empty, a FIT header, not shorter than the header says; the CRC is not checked); a bad download writes nothing and is reported. Only NEW files are written: nothing at Suunto is changed, and nothing is ever deleted or overwritten; a record that is damaged, of another version, filed under another key or whose FIT is missing or has another size is reported in refused and left as it is (the user fixes or moves it), and a FIT file already there that differs blocks that workout with an error. The record file is written last and is the mark 'archived', so an interrupted call is completed by the next one. Reads the newest 1000 workouts from the list per call (50 per request): older ones are not reachable. Output: { dir, listed, alreadyArchived, newlyArchived, archived, remaining, refused: [{ workoutKey, problem }], errors: [{ workoutKey, error }], notes }. estimate_route_time reads the archived FIT files; get_exercise_history, get_training_load and the other tools do NOT read the archive. Annotated not read-only (it writes local files), not destructive, NOT idempotent (each call archives the next batch) and open-world (it contacts Suunto). In demo mode the archive lives in memory.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "archive_workouts"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Most FIT files to download in this call (default and maximum 20). |