Skip to main content
Glama

Eight Sleep Sleep Efficiency

eight_sleep_efficiency
Read-onlyIdempotent

Calculate sleep efficiency for recent nights using in-bed and asleep times to identify excellent, good, fair, or poor sleep quality and spot trends or dips.

Instructions

v0.2.2 — Sleep efficiency calculator. For each of the last N nights (default 7), computes time_in_bed_minutes (from presenceDuration), time_asleep_minutes (from sleepDuration), efficiency_pct = (asleep / in_bed) * 100, and efficiency_band (excellent ≥85, good 75-84, fair 65-74, poor <65). Returns nights_analyzed, mean / median / min-night / max-night efficiency, a nights_by_band breakdown, per_night array, and natural-language observations (mid-week drop, all-nights-same-band, single-night dip > 15 points below mean) ONLY when supported by the data. Reuses the existing /v1/users/{id}/trends payload — no extra API calls. Graceful degradation when upstream omits presenceDuration / sleepDuration (returns nights_analyzed: 0 with a clarifying note).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nightsNoNumber of recent nights to analyze. Default 7.
timezoneNoIANA timezone for grouping nightly records. Default UTC.UTC
response_formatNomarkdown

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.13
  2. Removedv0.2.6
  3. First observedv0.2.5

TDQS

A4.5/5.0
Behavior5/5

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

Despite annotations already declaring readOnlyHint, idempotentHint, and destructiveHint=false, the description adds substantial behavioral detail: the exact efficiency formula, band thresholds, conditional natural-language observations, and graceful degradation when upstream fields are missing. This goes well beyond what annotations alone communicate.

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 dense but every clause earns its place: the formula, band thresholds, output fields, conditional observations, reuse of the payload, and graceful degradation are all present without filler. The core purpose is front-loaded and structure follows logically.

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?

With no output schema, the description fully enumerates the return fields and edge-case behavior, which is essential for an agent anticipating tool results. It also covers the practical concern of extra API calls and missing upstream data, making the description complete for this tool's complexity.

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%, and the description reinforces the `nights` default and purpose but does not add meaningful semantics for `timezone` or `response_format`. The schema already describes timezone adequately, and response_format is self-explanatory from its enum, so the description neither significantly compensates nor creates gaps.

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 opens with 'Sleep efficiency calculator' and immediately specifies the exact computation: time_in_bed_minutes, time_asleep_minutes, efficiency_pct, and efficiency_band. It clearly distinguishes this tool as a derived analysis layer over the trends payload, not just another raw data getter among the siblings.

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?

Provides clear context: it analyzes the last N nights, defaults to 7, and reuses the existing /v1/users/{id}/trends payload with no extra API calls. It stops short of explicitly naming alternative tools for when this analysis is or isn't appropriate, so it misses the full when/when-not comparison.

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