Skip to main content
Glama
nissand

WHOOP MCP Server

by nissand

whoop-get-sleep-by-id

Retrieve detailed sleep analysis data from WHOOP by specifying a sleep record ID to access metrics and insights.

Instructions

Get the sleep record for the specified ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sleepIdYesID of the sleep record to retrieve

Implementation Reference

  • Core handler function that executes the tool logic by fetching sleep record by ID from the Whoop API.
    async getSleepById(sleepId: string): Promise<WhoopSleep> {
      const response = await this.client.get(`/activity/sleep/${sleepId}`);
      return response.data;
    }
  • MCP server tool call handler that validates input arguments and delegates to WhoopApiClient.getSleepById, formats response.
    case 'whoop-get-sleep-by-id': {
      if (!args || typeof args.sleepId !== 'string') {
        throw new Error('sleepId is required and must be a string');
      }
      const result = await this.whoopClient.getSleepById(args.sleepId);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Tool registration in the ListToolsRequest handler, including name, description, and input schema.
    {
      name: 'whoop-get-sleep-by-id',
      description: 'Get the sleep record for the specified ID',
      inputSchema: {
        type: 'object',
        properties: {
          sleepId: {
            type: 'string',
            description: 'ID of the sleep record to retrieve',
          },
        },
        required: ['sleepId'],
      },
    },
  • TypeScript interface defining the structure of sleep data returned by the tool.
    export interface WhoopSleep {
      id: string;
      v1_id: number;
      user_id: number;
      created_at: string;
      updated_at: string;
      start: string;
      end: string;
      timezone_offset: string;
      nap: boolean;
      score_state: string;
      score?: WhoopSleepScore;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states this is a retrieval operation ('Get'), which implies read-only behavior, but doesn't mention authentication requirements, rate limits, error conditions, or what the return format looks like. For a tool with zero annotation coverage, this leaves significant behavioral gaps.

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 that gets straight to the point with zero wasted words. It's appropriately sized for a simple retrieval tool and front-loads the essential information.

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?

For a retrieval tool with no annotations and no output schema, the description should provide more context about what information is returned, authentication requirements, and how this tool differs from sibling sleep tools. The current description is too minimal given the lack of structured metadata about behavior and output.

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?

The schema description coverage is 100%, with the single parameter 'sleepId' fully documented in the schema as 'ID of the sleep record to retrieve'. The description doesn't add any additional parameter semantics beyond what's already in the schema, so it meets the baseline of 3 for high schema coverage.

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 ('Get') and resource ('sleep record') with specific targeting ('for the specified ID'), which is a specific verb+resource combination. However, it doesn't explicitly differentiate from sibling tools like 'whoop-get-sleep-collection' or 'whoop-get-sleep-for-cycle', which would require a 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'whoop-get-sleep-collection' (for multiple records) or 'whoop-get-sleep-for-cycle' (for cycle-specific sleep). It simply states what the tool does without context about when it's appropriate versus other sleep-related tools.

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