Skip to main content
Glama

garmin_sleep_analysis

Read-onlyIdempotent

Analyze Garmin sleep over a chosen period to compare duration against baseline need, track regularity, stages, HRV, and prior-day factors, then explain poor sleep and guide recommendations.

Instructions

Sleep quality analysis over a period (default 28 days, up to 366): average duration vs Garmin's baseline sleep need and weekly shortfall, regularity (median sleep onset and wake time, spread, weekday-weekend shift), stage shares, sub-score counts, score trend, sleep heart rate, HRV, resting HR, SpO2, respiration, and factors from the previous day (stress above usual, late or hard workouts, low activity, late sleep onset) compared with sleep score, HRV and sleep HR. Use this first for sleep questions and recommendations.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "garmin_sleep_analysis"
  }
}

Input Schema

NameRequiredDescriptionDefault
daysNoNumber of days ending at end_date, used when start_date is omitted.
end_dateNoLast day, YYYY-MM-DD. Default: today.
start_dateNoFirst day, YYYY-MM-DD in the user's local calendar. Default: computed from end_date and days.

Output Schema

NameRequiredDescriptionDefault
toYes
fromYes
notesYes
factorsYes
averagesYes
regularityYes
best_nightsYes
worst_nightsYes
stage_share_pctYes
nights_with_dataYes
sub_score_countsNo
score_trend_nightsYes
score_trend_per_weekNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true and openWorldHint=true, so safety and idempotency are covered structurally. The description adds useful context about the computed window and the 366-day ceiling, but is silent on cost/latency of a long multi-metric aggregation, which matters for a tool that can pull a year of data.

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?

Front-loaded with the purpose and period bounds before the metric inventory, with zero filler sentences. The single long enumerated sentence is dense and would scan better as a short bulleted list, but every clause carries information an agent would otherwise have to infer.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a rich aggregation tool with an output schema, three optional parameters at full coverage, and clear safety annotations, the description covers purpose, window semantics, and contents adequately. The only meaningful omission is guidance on choosing between this and the plain garmin_sleep sibling.

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?

Schema coverage is 100%, so the baseline is 3, and the description exceeds it by supplying the default period (28 days) and the maximum (366), neither of which appear in the schema. It does not repeat the start_date/end_date precedence rules, but the schema already explains those.

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?

States a specific verb and resource ("Sleep quality analysis over a period") and then enumerates the exact metrics produced — duration vs baseline need, regularity, stage shares, HRV, SpO2, and prior-day factors — so an agent knows precisely what data comes back. It positions itself as the primary sleep tool ("Use this first for sleep questions") but never names the sibling garmin_sleep it is presumably competing with, so the differentiation is implied rather than explicit.

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?

Gives clear routing guidance with a priority directive ("Use this first for sleep questions and recommendations") and bounds the window (default 28 days, up to 366), which tells the agent when this is the right entry point. It stops short of saying when NOT to use it, e.g. for a single night's raw sleep record versus this aggregate analysis.

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