Skip to main content
Glama

withings_get_sleep

Retrieve nightly sleep summaries or detailed sleep phases with heart rate and respiratory rate for a date range; detailed requests are live and limited to 7 days.

Instructions

Get sleep data (summaries or detailed phases).

Summary mode (default): nightly totals with duration, sleep score, HR, respiratory rate, and snoring. From local cache unless live=True.

Detail mode (detail=True): minute-by-minute sleep phases (awake, light, deep, REM) with HR and respiratory rate. Always fetched live. Maximum 7 days per request (Withings API limit).

Args: start_date: Start date as "YYYY-MM-DD", "YYYY-MM", or "7d". Default: 7 days (detail) or 30 days (summary) back from the end date or today, whichever is earlier. end_date: End date as "YYYY-MM-DD", "YYYY-MM" (its last day), or "Nd". Default: today. detail: If true, return minute-by-minute sleep phases instead of nightly summaries. Always live, max 7 days. live: If true, fetch summaries from API instead of cache. Ignored when detail=True (always live).

Returns nightly sleep data sorted by date. Not for body composition -- use withings_get_body instead.

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

Input Schema

NameRequiredDescriptionDefault
liveNo
detailNo
end_dateNo
start_dateNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.11.0
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "title": "Result",
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "title": "withings_get_sleepOutput",
      -  "type": "object"
      -}New value: +null
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so well: it discloses that summaries come from a local cache unless live=True, that detail mode is always fetched live and ignores the live flag, and that the Withings API caps requests at 7 days. These are non-obvious operational traits an agent could not infer from the schema.

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 structure is strong — mode behavior is front-loaded, parameters follow in a clean Args block, and a closing line handles the return and the sibling exclusion. Minor cost: the closing line 'Returns nightly sleep data sorted by date' is misleading for detail mode, which returns minute-level phases rather than nightly rows.

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?

For a four-parameter tool with no annotations and no output schema, the description covers everything an agent needs to call it correctly: mode semantics, caching behavior, API limits, date format options, and defaults. The only light gap is the precise shape of the detail-mode return, but the summary of fields (phases, HR, respiratory rate) is sufficient to decide whether to request it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must define all four parameters, and it does: accepted date formats ('YYYY-MM-DD', 'YYYY-MM', '7d', 'Nd'), what 'YYYY-MM' expands to (its last day), and the asymmetric defaults (7 days back for detail, 30 for summary). It also explains the interaction between detail and live, which the schema cannot express.

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 ('Get sleep data') and immediately splits it into two named modes (summary vs. detail phases), each described with its actual contents. It also names a sibling to avoid ('Not for body composition -- use withings_get_body'), so an agent can distinguish it from the surrounding Withings tools without opening any schema.

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?

It gives explicit mode selection guidance ('detail=True' for minute-by-minute phases, default summary for nightly totals) plus a hard constraint ('Maximum 7 days per request') and a sibling redirect for body data. What's missing is guidance on when a caller should prefer live over cache beyond the implicit default, and no mention of the other siblings (heart, trends, activity) that might overlap with sleep-adjacent queries.

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