whoop-get-cycle-collection
Retrieve paginated physiological cycle data for WHOOP users, including sleep, recovery, and workout metrics with optional date range filtering.
Instructions
Get all physiological cycles for a user, paginated
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Limit on the number of cycles returned (max 25) | |
| start | No | Return cycles that occurred after or during this time (ISO 8601) | |
| end | No | Return cycles that intersect this time or ended before this time (ISO 8601) | |
| nextToken | No | Next token from the previous response to get the next page |
Implementation Reference
- src/mcp-server.ts:353-368 (handler)MCP tool dispatch handler for 'whoop-get-cycle-collection' that delegates to WhoopApiClient.getCycleCollection with parsed argumentscase 'whoop-get-cycle-collection': { const result = await this.whoopClient.getCycleCollection({ limit: args?.limit as number | undefined, start: args?.start as string | undefined, end: args?.end as string | undefined, nextToken: args?.nextToken as string | undefined, }); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/whoop-api.ts:64-75 (handler)Core implementation that constructs API query parameters and fetches cycle collection data from Whoop API using axiosasync getCycleCollection(params?: PaginationParams): Promise<WhoopCycleCollection> { const queryParams = new URLSearchParams(); if (params?.limit) queryParams.append('limit', params.limit.toString()); if (params?.start) queryParams.append('start', params.start); if (params?.end) queryParams.append('end', params.end); if (params?.nextToken) queryParams.append('nextToken', params.nextToken); const url = `/cycle${queryParams.toString() ? `?${queryParams.toString()}` : ''}`; const response = await this.client.get(url); return response.data; }
- src/mcp-server.ts:76-101 (registration)Tool registration entry in ListToolsResponse, including description and input schema definition{ name: 'whoop-get-cycle-collection', description: 'Get all physiological cycles for a user, paginated', inputSchema: { type: 'object', properties: { limit: { type: 'number', description: 'Limit on the number of cycles returned (max 25)', }, start: { type: 'string', description: 'Return cycles that occurred after or during this time (ISO 8601)', }, end: { type: 'string', description: 'Return cycles that intersect this time or ended before this time (ISO 8601)', }, nextToken: { type: 'string', description: 'Next token from the previous response to get the next page', }, }, required: [], }, },
- src/types.ts:163-168 (schema)TypeScript interface defining the input parameters for cycle collection queriesexport interface PaginationParams { limit?: number; start?: string; end?: string; nextToken?: string; }
- src/types.ts:34-37 (schema)TypeScript interface defining the output structure for cycle collection responsesexport interface WhoopCycleCollection { records: WhoopCycle[]; next_token?: string; }