whoop-set-access-token
Configure API authentication by setting the access token required to retrieve WHOOP fitness data including sleep analysis, recovery metrics, and workout information.
Instructions
Set the access token for API calls
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| accessToken | Yes | Access token to use for API calls |
Input Schema (JSON Schema)
{
"properties": {
"accessToken": {
"description": "Access token to use for API calls",
"type": "string"
}
},
"required": [
"accessToken"
],
"type": "object"
}
Implementation Reference
- src/mcp-server.ts:527-540 (handler)Executes the tool logic: validates the accessToken input and calls setAccessToken on the WhoopApiClient.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)Registers the tool in the listTools handler, including name, description, and input schema definition.{ 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/whoop-api.ts:39-41 (helper)Helper method in WhoopApiClient that stores the provided access token in the config, which is used by the axios interceptor for API requests.setAccessToken(accessToken: string) { this.config.accessToken = accessToken; }