Skip to main content
Glama

sleep-debt-calculator

Read-onlyIdempotent

Compute cumulative sleep debt across the last 7 nights given a personal target. Returns total debt in hours, per-night deficits, the worst night, and an estimate of how many nights at +1h over target would clear the debt. Severity is banded for UI color-coding. Educational only — does not replace clinical sleep assessment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actual_hoursYesActual sleep hours for the last 7 nights, most recent night LAST. Each entry 0-24. Use 0 for an all-nighter; partial hours allowed (e.g. 6.5).
target_hoursYesPersonal target sleep hours per night. Most adults need 7-9 (default 8). Should reflect the amount of sleep you feel rested after, not an aspirational number.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
severityYesBanded severity for color-coding the result. 'none' = no debt; <6h mild; 6-12h moderate; 12-20h severe; >20h extreme.
recovery_nightsYesEstimated nights to clear the debt assuming +1 hour over target per night. Educational — full cognitive recovery from chronic sleep loss takes longer than the math suggests (see Why We Sleep).
total_debt_hoursYesCumulative sleep debt in hours over the 7-night window. Nights where you slept AT OR ABOVE the target contribute zero (no negative debt — surplus sleep doesn't bank).
per_night_deficitYesPer-night deficit (target - actual), clamped to 0. Same order as actual_hours.
worst_night_indexYes0-indexed position of the night with the largest deficit (target - actual). -1 if no night was below target.
nights_below_targetYesCount of nights where actual_hours < target_hours.
average_actual_hoursYesMean of actual_hours across all 7 nights, regardless of target.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the readOnly and idempotent annotation hints, the description discloses what the calculation returns (total debt, per-night deficits, worst night, clearance estimate), mentions severity banding for UI color-coding, and adds an important educational-only disclaimer. This is rich, useful behavioral context with no contradiction to annotations.

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 three tightly written sentences with the main action front-loaded. Every sentence adds value: computation scope, return details/severity banding, and the educational disclaimer. There is no filler or repetition of schema content.

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?

Given the simple 2-parameter input, rich annotations, and presence of an output schema, the description is complete. It explains the purpose, expected outputs, severity presentation, and safety caveat, so an agent has enough context to invoke it correctly.

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 description coverage is 100%, so the baseline is 3. The description reinforces 'personal target' but does not add parameter formatting or constraints beyond what the schema already provides. The schema descriptions for actual_hours and target_hours carry the substantive semantic detail.

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 a specific verb and resource: 'Compute cumulative sleep debt across the last 7 nights given a personal target.' It precisely scopes the operation and clearly distinguishes it from sibling calculators like jet-lag-calculator or average-calculator. Listing the return outputs further clarifies exactly what the tool does.

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?

The description gives clear context: it is for computing sleep debt over the last 7 nights against a personal target. It also includes a when-not-to-use exclusion ('does not replace clinical sleep assessment'). However, it does not explicitly name alternative tools or contrast with sibling calculators, so it stops short of full alternative guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources