Skip to main content
Glama

whoop-refresh-token

Refresh WHOOP API access tokens to maintain continuous data access for fitness tracking and health monitoring applications.

Instructions

Refresh access token using refresh token

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refreshTokenYesRefresh token to use for getting new access token

Implementation Reference

  • MCP server tool handler for 'whoop-refresh-token': validates input arguments and delegates to WhoopApiClient.refreshToken method.
    case 'whoop-refresh-token': { if (!args || typeof args.refreshToken !== 'string') { throw new Error('refreshToken is required and must be a string'); } const result = await this.whoopClient.refreshToken(args.refreshToken); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
  • Registration of the 'whoop-refresh-token' tool in the ListTools response, including description and input schema.
    { name: 'whoop-refresh-token', description: 'Refresh access token using refresh token', inputSchema: { type: 'object', properties: { refreshToken: { type: 'string', description: 'Refresh token to use for getting new access token', }, }, required: ['refreshToken'], }, },
  • Implementation of refreshToken method in WhoopApiClient: performs OAuth refresh token request to Whoop API endpoint.
    async refreshToken(refreshToken: string): Promise<{ access_token: string; refresh_token: string; expires_in: number }> { const formData = new URLSearchParams(); formData.append('client_id', this.config.clientId); formData.append('client_secret', this.config.clientSecret); formData.append('refresh_token', refreshToken); formData.append('grant_type', 'refresh_token'); const response = await axios.post('https://api.prod.whoop.com/oauth/oauth2/token', formData, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }); return response.data; }

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