Skip to main content
Glama

Get sleep

get_sleep
Read-only

Retrieve one night's sleep details or a multi-night range, including stages, score, SpO2, respiration, HRV, and trends, to review sleep quality and recovery.

Instructions

Sleep for one night with stages, score, SpO2, respiration, overnight HRV and a timeline (stage segments, awakenings, lowest HR, HRV and SpO2 with times), or for a range a per-night table with averages and trends. Use it for sleep stages and the detail of particular nights; for sleep hours next to other daily metrics, or months by week, use query_health. A night is named by the date of the morning it ended on: the night of 7 to 8 October is 2026-10-08. No arguments returns the last 7 nights; a range can span up to 3 years, one row per night. Nights not in the cache yet are downloaded from Garmin within the daily request limit, and a night without sleep data comes back as sleep null.

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": "get_sleep"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoRange end; default today
dateNoOne night, by the date of the morning; takes precedence over from/to
fromNoRange start; default 6 days before `to`

Output Schema

NameRequiredDescriptionDefault
dataYes
metaYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.8.0
    • addedOutput schema / properties / data / properties / end_local
      Added value: +{
      +  "type": "string"
      +}
    • removedOutput schema / properties / data / properties / end_utc
      Removed value: -{
      -  "type": "string"
      -}
    • addedOutput schema / properties / data / properties / start_local
      Added value: +{
      +  "type": "string"
      +}
    • removedOutput schema / properties / data / properties / start_utc
      Removed value: -{
      -  "type": "string"
      -}
  2. Changed1 schema field changedv0.7.0
    • addedOutput schema / properties / data / properties / timeline
      Added value: +{
      +  "additionalProperties": {},
      +  "properties": {
      +    "awakenings": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "at": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "count": {
      +          "type": "number"
      +        },
      +        "longest_at": {
      +          "type": "string"
      +        },
      +        "longest_min": {
      +          "type": "number"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "body_battery": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "end": {
      +          "type": "number"
      +        },
      +        "start": {
      +          "type": "number"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "hrv": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "max_at": {
      +          "type": "string"
      +        },
      +        "max_ms": {
      +          "type": "number"
      +        },
      +        "min_at": {
      +          "type": "string"
      +        },
      +        "min_ms": {
      +          "type": "number"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "lowest_spo2": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "at": {
      +          "type": "string"
      +        },
      +        "pct": {
      +          "type": "number"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "min_hr": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "at": {
      +          "type": "string"
      +        },
      +        "bpm": {
      +          "type": "number"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "restless_moments": {
      +      "type": "number"
      +    },
      +    "stages": {
      +      "items": {
      +        "additionalProperties": {},
      +        "properties": {
      +          "from": {
      +            "type": "string"
      +          },
      +          "stage": {
      +            "type": "string"
      +          },
      +          "to": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  3. Changed4 schema fields changedv0.6.2
    • removedInput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / properties / date / description
      Added value: +"One night, by the date of the morning; takes precedence over from/to"
    • addedInput schema / properties / from / description
      Added value: +"Range start; default 6 days before `to`"
    • addedInput schema / properties / to / description
      Added value: +"Range end; default today"
  4. First observedv0.6.0

TDQS

A4.6/5.0
Behavior4/5

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

Beyond readOnlyHint/openWorldHint, it discloses default behavior with no arguments (last 7 nights), the 3-year range cap, one-row-per-night output granularity, cache-miss downloads subject to a daily request limit, and the sleep=null case for nights without data. That is substantial disclosure, though it does not quantify the request limit or say how downloads affect latency.

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?

Content is front-loaded on what the tool returns, followed by routing guidance, then behavioral caveats such as the date convention and cache rules. The sentences are long and dense but carry no filler; a slightly tighter split would improve scannability.

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?

An output schema exists so return shapes need not be spelled out, yet the description still covers defaults, range limits, row granularity, date semantics and the missing-data case. For a read-only retrieval tool with three optional parameters, nothing an agent needs in order to call it 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?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning: the night-naming convention with a worked example (night of 7-8 October is 2026-10-08) and the effective default span of 7 nights. Those clarify how to populate the date/from/to parameters in a way the schema alone does not.

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 names a specific resource and enumerates exactly what it returns (stages, score, SpO2, respiration, HRV, timeline segments) plus the alternative range shape (per-night table with averages and trends). It explicitly distinguishes itself from the sibling query_health, so an agent can route without opening either schema.

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 gives an explicit when-to-use (sleep stages, detail of particular nights) and an explicit when-not with the named alternative and its use case (sleep hours beside other daily metrics, or months by week -> query_health). Nothing about tool selection is left to inference.

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