Skip to main content
Glama

whoop-get-workout-by-id

Retrieve detailed workout data from WHOOP by providing a specific workout ID to access performance metrics and exercise records.

Instructions

Get the workout record for the specified ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workoutIdYesID of the workout record to retrieve

Implementation Reference

  • MCP server tool handler: validates workoutId input and calls WhoopApiClient.getWorkoutById to fetch and return the workout data as JSON.
    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 API client method that performs the HTTP GET request to Whoop's /activity/workout/{workoutId} endpoint and returns the workout object.
    async getWorkoutById(workoutId: string): Promise<WhoopWorkout> { const response = await this.client.get(`/activity/workout/${workoutId}`); return response.data; }
  • Tool registration in the listTools response, defining name, description, and input schema (workoutId: string).
    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'], }, },
  • TypeScript interface defining the output structure of the Whoop workout data.
    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