get_workout_samples
Retrieve time-series sample data for a specific workout, including heart rate, speed, altitude, power, cadence, and GPS coordinates, sampled at the device's recording interval.
Instructions
Returns the time-series sample stream for one workout. Each sample: timestamp (ms), heartRate (bpm), speed (m/s), altitude (m), power (W), cadence, latitude, longitude. Sampled at the device's recording interval (typically 1 s). Long workouts (>2 h) may return thousands of records — use get_workout_fit with full=false for a compact summary instead. Throws SuuntoNotFoundError if the key is invalid. Read-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workoutKey | Yes | Opaque server-assigned string returned by list_workouts. Not guessable or constructable — always discover via list_workouts first. Passing an invalid key throws SuuntoNotFoundError. |
Implementation Reference
- src/api.ts:118-120 (handler)The core API method that fetches workout sample time-series data from Suunto's cloud API endpoint /v2/workout/samples/{workoutKey}. It calls this.json<any>() which performs an authenticated HTTP GET with retry logic and returns parsed JSON.
getWorkoutSamples(workoutKey: string) { return this.json<any>(`/v2/workout/samples/${encodeURIComponent(workoutKey)}`); } - src/index.ts:98-113 (schema)MCP tool definition for 'get_workout_samples' including the description and inputSchema. Declares the tool name, description of the time-series sample stream (HR, speed, altitude, power, etc.), and the required 'workoutKey' string parameter.
{ name: "get_workout_samples", description: "Returns the time-series sample stream for one workout. Each sample: timestamp (ms), heartRate (bpm), speed (m/s), altitude (m), power (W), cadence, latitude, longitude. Sampled at the device's recording interval (typically 1 s). Long workouts (>2 h) may return thousands of records — use get_workout_fit with full=false for a compact summary instead. Throws SuuntoNotFoundError if the key is invalid. Read-only.", inputSchema: { type: "object", properties: { workoutKey: { type: "string", minLength: 1, description: "Opaque server-assigned string returned by list_workouts. Not guessable or constructable — always discover via list_workouts first. Passing an invalid key throws SuuntoNotFoundError.", }, }, required: ["workoutKey"], }, }, - src/index.ts:329-332 (registration)The MCP CallToolRequestSchema handler case that dispatches 'get_workout_samples' by calling suunto.getWorkoutSamples(a.workoutKey) and serializing the result as JSON text.
case "get_workout_samples": { const data = await suunto.getWorkoutSamples(a.workoutKey); return text(JSON.stringify(data)); } - src/cli.ts:79-83 (helper)CLI handler for the 'get-workout-samples' command. Extracts the workoutKey from positional args, calls suunto.getWorkoutSamples(key), and outputs the result as JSON.
case "get-workout-samples": { const key = rest[0] ?? die("Usage: get-workout-samples <workoutKey>"); out(await suunto.getWorkoutSamples(key)); break; }