Skip to main content
Glama

whoop-get-workout-by-id

Retrieve detailed workout data from WHOOP using a specific workout ID to analyze performance metrics and exercise sessions.

Instructions

Get the workout record for the specified ID

Input Schema

NameRequiredDescriptionDefault
workoutIdYesID of the workout record to retrieve

Input Schema (JSON Schema)

{ "properties": { "workoutId": { "description": "ID of the workout record to retrieve", "type": "string" } }, "required": [ "workoutId" ], "type": "object" }

Implementation Reference

  • Tool registration in listTools handler, including input schema definition.
    { name: 'whoop-get-workout-by-id', description: 'Get the workout record for the specified ID', inputSchema: { type: 'object', properties: { workoutId: { type: 'string', description: 'ID of the workout record to retrieve', }, }, required: ['workoutId'], }, },
  • MCP tool handler: validates input arguments and delegates to WhoopApiClient.getWorkoutById, returns JSON stringified response.
    case 'whoop-get-workout-by-id': { if (!args || typeof args.workoutId !== 'string') { throw new Error('workoutId is required and must be a string'); } const result = await this.whoopClient.getWorkoutById(args.workoutId); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
  • Core implementation: Performs authenticated GET request to Whoop API endpoint for specific workout data.
    async getWorkoutById(workoutId: string): Promise<WhoopWorkout> { const response = await this.client.get(`/activity/workout/${workoutId}`); return response.data; }
  • TypeScript interface defining the structure of Whoop workout data (output schema).
    export interface WhoopWorkout { id: string; v1_id: number; user_id: number; created_at: string; updated_at: string; start: string; end: string; timezone_offset: string; sport_name: string; sport_id: number; score_state: string; score?: WhoopWorkoutScore; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nissand/whoop-mcp-server-claude'

If you have feedback or need assistance with the MCP directory API, please join our Discord server