Estimate a route's time from your own pace (and the latest start before sunset)
estimate_route_timeEstimate how long a saved route will take for you by modeling your pace from workout history, distance, climbing, and descent; add a sunset to get a latest start time.
Instructions
How long a saved Suunto route will take THIS user, from their own pace on hills. It reads the route's GPX (one request, as export_route) and the user's local workout archive (archive_workouts; no Suunto request for them) and fits time = flat pace x distance + extra time per metre climbed + extra time per metre descended (Naismith's rule with the three constants fitted by least squares to the 100 m pieces of the user's archived walking and hiking workouts, or running ones with activity 'running': record-level distance, altitude and time from each FIT file, pauses over 30 s left out, implausible speeds and altitude glitches dropped; the newest 25 usable ones of the 40 newest archived). Workouts imported with import_workouts from other systems are used as well, after the Suunto archive and only for the places it leaves free (an imported workout that starts within a minute of an archived one is not counted twice); model.workoutsUsed counts imported workouts too, while workoutsConsidered and skipped count the Suunto archive only (so workoutsUsed can exceed workoutsConsidered); an imported workout counts only if its sport is walking, hiking or running (activity 'walking' takes walking and hiking). model.sources says how many of each kind were usable: { suuntoArchive, imported, importedBySource, importedSkipped: { otherSport, noMotionData, unreadable, duplicateOfArchive } }. It needs at least 3 usable workouts of 1 km or more, 15 km of track, 300 m of climbing and 300 m of descent together; otherwise model.status is 'insufficient' with the reason, and the estimate falls back to the generic Naismith rule (5 km/h plus 1 h per 600 m climbed, nothing for descent), labelled basis 'generic-naismith': say so to the user, it is NOT their pace (the demo archive has no altitude, so demo mode always falls back). A route without altitude on every point is estimated as flat ground, with a note. Output: { route: { name, points, distanceM, ascentM, descentM, hasElevation }, activity, basis ('personal' | 'generic-naismith'), model: { status, reason?, workoutsUsed, workoutsConsidered, skipped: { otherSport, noMotionData, unreadable }, distanceM, ascentM, descentM, flatPaceSPerKm, ascentSPerM (extra seconds per metre climbed), descentSPerM, gradeRangePct { min, max } (the steepest descent and ascent the model was fitted to), inSampleErrorPct (median error of the model against the user's own workouts' total times: fit to the past, not a forecast) }, estimate: { totalTimeS, totalTime, outsideRangeM (metres steeper than anything in the user's workouts, where the fitted pace is extrapolated: a note says so, 0 for the generic fallback), byKind: { flat | ascent | descent: { distanceM, timeS } }, splits: [{ kind, startM, distanceM, ascentM, descentM, timeS, outsideRangeM }] } (pieces at or above +3 % are ascent, at or below -3 % descent, else flat; stretches under 300 m are merged into the one before), latestStart: { sunset, marginMinutes, latestStart (in the sunset's own UTC offset), latestStartUtc, finishBy, alreadyPast } | null, assumptions, notes }. sunset is an ISO 8601 date-time WITH its UTC offset that the USER supplies (no sunset is looked up and nothing external is called); latestStart = sunset minus marginMinutes (default 30, 0-360) minus the estimated time; daylight after sunset is not considered. It is an ESTIMATE of moving time: no stops, weather, load, surface or fatigue. Read-only: it writes nothing.
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": {
"routeId": "<routeId>"
},
"name": "estimate_route_time"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sunset | No | Optional: the sunset (or any finish-by time) as ISO 8601 date-time with its UTC offset, supplied by the user. Adds latestStart. | |
| routeId | Yes | Route ID, e.g. from list_routes or upload_route. | |
| activity | No | Which of the user's archived workouts set the pace: 'walking' (FIT sport walking or hiking, the default) or 'running'. | walking |
| marginMinutes | No | With sunset: minutes to be back before it (default 30). |