Skip to main content
Glama

Exchange WHOOP OAuth Code

whoop_exchange_code

Exchange a WHOOP OAuth authorization code for locally stored tokens kept with 0600 permissions. Requires explicit user intent, so agents cannot call it autonomously.

Instructions

Exchange a WHOOP OAuth authorization code for local tokens. Tokens are stored locally with 0600 permissions and are never returned by this tool. Gated: requires explicit user intent — agents must not call this autonomously.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesOAuth authorization code, or a full redirect URL containing ?code=...
stateNoOptional OAuth state from the redirect URL. Recommended for PKCE verification.
response_formatNomarkdown

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
noteYes
scopeNo
expires_atNo
token_pathYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.6.6
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed1 schema field changedv0.6.5
    • addedInput schema / properties / state
      Added value: +{
      +  "description": "Optional OAuth state from the redirect URL. Recommended for PKCE verification.",
      +  "type": "string"
      +}
  3. Addedv0.6.1
  4. Removedv0.5.4
  5. First observedv0.5.3

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already cover readOnly/idempotent/openWorld, and the description adds genuinely new behavioral context: tokens are stored locally with 0600 permissions and are never returned by this tool, plus the autonomous-call prohibition. No contradiction with the annotations (readOnlyHint=false matches an exchange/write operation).

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?

Two sentences, both earning their place, with the security/gating constraint front-loaded alongside the purpose. No filler.

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

Completeness5/5

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

An output schema exists, so return values need not be described, and the description usefully clarifies that tokens are not part of the response. The safety-relevant facts an agent needs before invoking are all present.

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

Parameters3/5

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

Schema coverage is 67%; the code and state parameters have their own schema descriptions. The description adds no meaning for code/state/response_format, so it neither compensates for the gap nor introduces confusion. Baseline 3 applies.

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

Purpose5/5

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

Names a specific verb (exchange) and resource (WHOOP OAuth authorization code) and states the outcome (local tokens). It is clearly distinct from the sibling whoop_get_auth_url, which obtains the code rather than redeeming it.

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

Usage Guidelines4/5

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

Explicitly states when NOT to call it: 'Gated: requires explicit user intent — agents must not call this autonomously.' That is a strong conditional guardrail, though it does not name an alternative tool or the precondition flow (get_auth_url first).

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