whoop-set-access-token
Configure API authentication by setting the access token required to retrieve WHOOP fitness and health data through the MCP server.
Instructions
Set the access token for API calls
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accessToken | Yes | Access token to use for API calls |
Implementation Reference
- src/mcp-server.ts:527-540 (handler)Handler for the 'whoop-set-access-token' tool: validates the accessToken input and delegates to WhoopApiClient.setAccessToken, returning success message.case 'whoop-set-access-token': { if (!args || typeof args.accessToken !== 'string') { throw new Error('accessToken is required and must be a string'); } this.whoopClient.setAccessToken(args.accessToken); return { content: [ { type: 'text', text: 'Access token set successfully', }, ], }; }
- src/mcp-server.ts:277-290 (registration)Registration of the 'whoop-set-access-token' tool in the listTools handler, including name, description, and input schema.{ name: 'whoop-set-access-token', description: 'Set the access token for API calls', inputSchema: { type: 'object', properties: { accessToken: { type: 'string', description: 'Access token to use for API calls', }, }, required: ['accessToken'], }, },
- src/mcp-server.ts:280-289 (schema)Input schema definition for the 'whoop-set-access-token' tool.inputSchema: { type: 'object', properties: { accessToken: { type: 'string', description: 'Access token to use for API calls', }, }, required: ['accessToken'], },
- src/whoop-api.ts:39-41 (helper)Core helper method in WhoopApiClient that sets the access token in the config, which is used by the axios interceptor for Authorization headers in subsequent API calls.setAccessToken(accessToken: string) { this.config.accessToken = accessToken; }