Skip to main content
Glama

set_sleep_window

Sets one night's bedtime and wake time, moving or creating the sleep window filed under the wake-up date.

Instructions

Sets one night's bedtime and wake time, moving it or creating it; filed under the wake-up date. Sets one night's bedtime and wake time, as Garmin Connect's edit-sleep-times dialog does. cdate is the date Garmin files the night under, the WAKE-UP day. Reads the night through getSleepData first. A RECORDED night's id is its current sleepStartTimestampGMT in epoch ms and CHANGES after every edit, so it is read fresh, then PUT to /sleep-service/sleep/dailySleep/{id} with `{calendarDate, sleepStartTimestampGMT, sleepEndTimestampGMT, sleepTimeSeconds, napTimeSeconds, sleepWindowConfirmed:…

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "cdate": "<cdate>",
      "sleepStart": "<sleepStart>",
      "sleepEnd": "<sleepEnd>"
    },
    "name": "set_sleep_window"
  }
}

Input Schema

NameRequiredDescriptionDefault
cdateYesCalendar date, YYYY-MM-DD (UTC)
sleepEndYesA moment in time, ISO 8601, e.g. 2026-09-28T07:30:00 (local) or with Z/offset
sleepStartYesA moment in time, ISO 8601, e.g. 2026-09-28T07:30:00 (local) or with Z/offset

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.11.1

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing the underlying mutate endpoint, the upsert behavior, and the non-obvious fact that a recorded night's id is its sleepStartTimestampGMT in epoch ms and changes after every edit — so it must be re-read each time. That id-instability warning is exactly the kind of trait an agent cannot infer from readOnlyHint=false and is essential to avoid a failed write.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The opening sentence is duplicated near-verbatim, wasting the most valuable position, and the trailing JSON payload listing is truncated mid-field. The useful facts are front-loaded, but the redundancy and the cut-off fragment weaken structure.

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 mutation tool with annotations covering safety and no output schema, the description supplies the read-modify-write loop, id semantics, and target endpoint. It omits what the call returns (e.g. the new id) and how the fields it lists (sleepTimeSeconds, napTimeSeconds, sleepWindowConfirmed) are derived, but that is a modest gap.

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 beyond the schema: cdate is the WAKE-UP day Garmin files the night under, which resolves the ambiguity of a night spanning two dates. It does not clarify the local-vs-UTC interpretation of sleepStart/sleepEnd relative to cdate, leaving some gap.

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?

States a specific verb and resource ('Sets one night's bedtime and wake time') plus the crucial scope detail that it moves an existing window or creates one, filed under the wake-up date. The reference to reading via getSleepData implicitly separates the write tool from the sleep-reading siblings.

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 an explicit prerequisite workflow: 'Reads the night through getSleepData first,' which tells the agent the read-then-write sequence before calling. It stops short of saying when not to use it or what to do when no recorded night exists, so it is clear context without full routing guidance.

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

Deploy Server

Other Tools