Skip to main content
Glama

Sleep analysis

get_sleep_analysis
Read-onlyIdempotent

Retrieve nightly sleep stages, performance, and efficiency for any period up to 90 days to analyze sleep patterns. Data is fetched live from WHOOP and read-only.

Instructions

Returns nightly sleep for the last days days (default 14), newest first, as a Markdown table: time asleep in hours (light, deep and REM sleep, not time in bed), sleep performance (%) and efficiency (%), then averages. Naps and nights WHOOP hasn't scored are left out, and each night counts toward the day the user woke up. Use it for sleep patterns. For last night's stages, use get_today; for the recovery those nights produced, use get_recovery_trends. Set days to match the question: 7 for the last week, 30 for the last month, up to 90. Read-only: it never changes the user's WHOOP data. It fetches the data live from WHOOP on every call and keeps no copy, so the answer is current; if WHOOP can't be reached, it says so. If WHOOP isn't connected yet, it returns a message asking to call get_auth_url.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daysNoHow many days to cover, counting back from today: 1 to 90, default 14.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv1.1.2
    • addedInput schema / properties / days / default
      Added value: +14
    • changedInput schema / properties / days / description
      Previous value: -"Number of days to analyze (default: 14, max: 90)"New value: +"How many days to cover, counting back from today: 1 to 90, default 14."
    • addedInput schema / properties / days / maximum
      Added value: +90
    • addedInput schema / properties / days / minimum
      Added value: +1
    • changedInput schema / properties / days / type
      Previous value: -"number"New value: +"integer"
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

The annotations already indicate read-only, open-world, idempotent, and non-destructive behavior, but the description adds valuable context beyond that: it fetches live data each call, keeps no copy, reports if WHOOP is unreachable, and instructs the user to call get_auth_url if not connected. This is exactly the kind of behavioral disclosure that helps an agent anticipate outcomes.

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

Conciseness4/5

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

The description is a single dense paragraph but every sentence carries useful information: output format, inclusions/exclusions, usage purpose, alternatives, parameter guidance, read-only nature, live fetching, error handling, and auth. It is front-loaded with the core function and remains efficient without padding. Slightly long but justifiably so.

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?

There is no output schema, but the description fully specifies the return format (Markdown table with sleep stage hours, performance %, efficiency %, and averages) and covers edge cases (naps excluded, nights without score, day attribution, connectivity errors, auth requirement). Nothing an agent needs to call this correctly is missing.

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 schema fully documents the `days` parameter (range, default, meaning), so the baseline is 3. The description adds extra value by explaining the effect of different values ('7 for the last week, 30 for the last month, up to 90') and clarifying that it counts back from today, which is not explicit in the schema. This elevates it slightly above baseline.

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?

The description states exactly what the tool does: returns nightly sleep for a specified number of days, newest first, in a Markdown table. It clearly distinguishes itself from siblings by naming get_today for last night's stages and get_recovery_trends for recovery, and it specifies the exact data included (sleep stages, performance, efficiency) and excluded (naps, unscored nights, time in bed).

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

Usage Guidelines5/5

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

It explicitly says when to use this tool ('Use it for sleep patterns') and when to use alternatives ('For last night's stages, use get_today; for the recovery those nights produced, use get_recovery_trends'). It also gives concrete guidance on setting the days parameter (7 for last week, 30 for last month, up to 90), leaving no ambiguity.

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