Skip to main content
Glama
nissand

WHOOP MCP Server

by nissand

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;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the tool refreshes an access token, implying a mutation (token update) but doesn't disclose behavioral traits like authentication requirements, rate limits, error conditions, or what happens to the old token. For a security-sensitive tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste: 'Refresh access token using refresh token'. It's front-loaded with the core action and resource, making it easy to parse. Every word earns its place, and there's no redundancy or unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (security-sensitive token refresh), lack of annotations, and no output schema, the description is incomplete. It doesn't explain return values (e.g., new access token, expiry), error handling, or dependencies on other tools. For a tool with no structured safety or output information, the description should provide more context to guide effective use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaning by clarifying that the 'refreshToken' parameter is used 'for getting new access token', which aligns with the schema's 100% coverage (the schema already describes it as 'Refresh token to use for getting new access token'). With high schema coverage, the baseline is 3, but the description reinforces the parameter's purpose, earning a slightly higher score. Since there's only one parameter, the description adequately supports it.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Refresh') and resource ('access token'), specifying it uses a refresh token. It distinguishes from siblings like 'whoop-exchange-code-for-token' (initial token acquisition) and 'whoop-set-access-token' (manual token setting), but doesn't explicitly name alternatives. The purpose is specific and actionable, though sibling differentiation could be more explicit.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when an access token needs refreshing, but provides no explicit guidance on when to use this tool versus alternatives like 'whoop-exchange-code-for-token' (for initial tokens) or 'whoop-set-access-token' (for manual setting). It doesn't mention prerequisites (e.g., having a valid refresh token) or exclusions. Usage context is implied but not detailed.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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