whoop-get-cycle-by-id
Retrieve detailed fitness and health cycle data from WHOOP by specifying a cycle ID to access recovery metrics, sleep analysis, and workout information.
Instructions
Get the cycle for the specified ID
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cycleId | Yes | ID of the cycle to retrieve |
Implementation Reference
- src/mcp-server.ts:63-75 (registration)Registration of the MCP tool 'whoop-get-cycle-by-id' including its description and input schema definition.name: 'whoop-get-cycle-by-id', description: 'Get the cycle for the specified ID', inputSchema: { type: 'object', properties: { cycleId: { type: 'number', description: 'ID of the cycle to retrieve', }, }, required: ['cycleId'], }, },
- src/mcp-server.ts:338-351 (handler)MCP CallToolRequest handler case for 'whoop-get-cycle-by-id' that performs input validation and calls the WhoopApiClient to execute the tool logic.case 'whoop-get-cycle-by-id': { if (!args || typeof args.cycleId !== 'number') { throw new Error('cycleId is required and must be a number'); } const result = await this.whoopClient.getCycleById(args.cycleId); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/whoop-api.ts:59-62 (helper)Core helper function in WhoopApiClient that makes the HTTP GET request to the Whoop API endpoint `/cycle/{cycleId}` to fetch the cycle data.async getCycleById(cycleId: number): Promise<WhoopCycle> { const response = await this.client.get(`/cycle/${cycleId}`); return response.data; }