Skip to main content
Glama

Eight Sleep Sleep Efficiency

eight_sleep_efficiency
Read-onlyIdempotent

Computes sleep efficiency (asleep vs in-bed) for each of the last N nights, providing mean, median, min, max, band breakdown, and natural-language observations on trends.

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
Behavior5/5

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

The description adds substantial behavioral detail beyond annotations: it reuses existing API payload with no extra calls, explains graceful degradation when data is missing, and states that natural-language observations are only included when supported by data. This provides excellent transparency.

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 well-structured and informative, with a version header, clear listing of computed metrics, and edge-case handling. It is slightly verbose but every sentence adds value. Minor improvements could combine some details.

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?

Without an output schema, the description fully explains the return structure: nights_analyzed, mean/median/min/max, per_night array, efficiency bands, and observations. It also covers edge cases like missing data. The tool is self-contained and clearly documented.

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 input schema covers all three parameters with descriptions and defaults (nights, timezone, response_format). The description adds little beyond stating the default of 7 nights, so it does not significantly enhance parameter understanding. Baseline of 3 is appropriate given 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 it is a sleep efficiency calculator that computes a specific set of metrics (time_in_bed, time_asleep, efficiency_pct, efficiency_band) and returns detailed analysis. However, it does not explicitly differentiate from sibling tools like eight_sleep_nightly_summary or eight_sleep_get_trends.

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 explains what the tool does but provides no explicit guidance on when to use it vs. alternatives. The usage context is implied (analyzing sleep efficiency over recent nights) but lacks clear conditions or exclusions.

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/davidmosiah/eight-sleep-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server