Skip to main content
Glama

log_sleep

Log an overnight sleep entry or a separate nap. use: a concrete sleep event from a tracker or recall. Question/habit/hypothetical alone: no write.

DATA COLLECTION: overnight entry without numbers -> ask: "How many hours did you sleep, and do you have a sleep score or stage breakdown from your tracker?" Nap -> NAPS.

INFER, do not ask: date = the local date the sleep or nap ended; default today.

NAPS: is_nap=true for a daytime nap or other short sleep separate from the main night, even when the user only says "I napped." Give its start (bedtime) and/or end (wake_time), plus duration (total_hours) or both times. Neither time known -> ask; never invent one. Naps must be under 3 hours. They are separate sessions and never replace or increase overnight sleep; overnight total_hours means the main night only.

Overnight entries accept any subset of fields. One row per date, updated on repeat. Every entry is tagged manual; wearable-provider sources are reserved for auto-sync.

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": {
      "date": "<date>"
    },
    "name": "log_sleep"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateYesLocal date the sleep or nap ended, YYYY-MM-DD; default today.
is_napNotrue = a separate nap; default false. See NAPS.
bedtimeNoBedtime / primary sleep session start: ISO 8601 timestamp (e.g. 2026-08-16T22:47:00-04:00) or HH:MM wall-clock time.
wake_timeNoWake time / primary sleep session end: ISO 8601 timestamp (e.g. 2026-08-17T06:21:00-04:00) or HH:MM wall-clock time.
awakeningsNoTimes woken during the night.
sleep_scoreNoSleep quality 0-100 (wearable scale). A 1-10 self-rating: multiply by 10 first.
total_hoursNoTotal sleep hours, e.g. 7.5.
rem_sleep_hoursNoREM sleep hours, when the tracker reports it.
deep_sleep_hoursNoDeep/slow-wave sleep hours, when the tracker reports it.
light_sleep_hoursNoLight sleep hours, when the tracker reports it.

Output Schema

NameRequiredDescriptionDefault
resultYesHuman-readable result text returned by the tool.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed10 schema fields changed
    • changedInput schema / properties / awakenings / description
      Previous value: -"Number of times woken during the night. Optional."New value: +"Times woken during the night."
    • changedInput schema / properties / bedtime / description
      Previous value: -"Bedtime / primary sleep session start time. Format: ISO 8601 timestamp (e.g. 2026-08-16T22:47:00-04:00) or HH:MM wall-clock time. Optional."New value: +"Bedtime / primary sleep session start: ISO 8601 timestamp (e.g. 2026-08-16T22:47:00-04:00) or HH:MM wall-clock time."
    • changedInput schema / properties / date / description
      Previous value: -"Local date the sleep or nap ended. Format: YYYY-MM-DD. Default to today."New value: +"Local date the sleep or nap ended, YYYY-MM-DD; default today."
    • changedInput schema / properties / deep_sleep_hours / description
      Previous value: -"Deep/slow-wave sleep in hours. Optional — include if the tracker reports it."New value: +"Deep/slow-wave sleep hours, when the tracker reports it."
    • changedInput schema / properties / is_nap / description
      Previous value: -"Whether this is a separate nap. Default false; see NAPS above."New value: +"true = a separate nap; default false. See NAPS."
    • changedInput schema / properties / light_sleep_hours / description
      Previous value: -"Light sleep in hours. Optional — include if the tracker reports it."New value: +"Light sleep hours, when the tracker reports it."
    • changedInput schema / properties / rem_sleep_hours / description
      Previous value: -"REM sleep in hours. Optional — include if the tracker reports it."New value: +"REM sleep hours, when the tracker reports it."
    • changedInput schema / properties / sleep_score / description
      Previous value: -"Sleep quality score on a 0-100 scale (matches wearable scoring). For a 1-10 self-rating, multiply by 10 first. Optional."New value: +"Sleep quality 0-100 (wearable scale). A 1-10 self-rating: multiply by 10 first."
    • changedInput schema / properties / total_hours / description
      Previous value: -"Total sleep duration in hours (e.g. 7.5). Optional."New value: +"Total sleep hours, e.g. 7.5."
    • changedInput schema / properties / wake_time / description
      Previous value: -"Wake time / primary sleep session end time. Format: ISO 8601 timestamp (e.g. 2026-08-17T06:21:00-04:00) or HH:MM wall-clock time. Optional."New value: +"Wake time / primary sleep session end: ISO 8601 timestamp (e.g. 2026-08-17T06:21:00-04:00) or HH:MM wall-clock time."
  2. Changed2 schema fields changed
    • changedInput schema / properties / date / description
      Previous value: -"Date of the sleep entry (night ending on this date). Format: YYYY-MM-DD. Default to today."New value: +"Local date the sleep or nap ended. Format: YYYY-MM-DD. Default to today."
    • addedInput schema / properties / is_nap
      Added value: +{
      +  "description": "Whether this is a separate nap. Default false; see NAPS above.",
      +  "type": "boolean"
      +}
  3. Changed2 schema fields changed
    • addedInput schema / properties / bedtime
      Added value: +{
      +  "description": "Bedtime / primary sleep session start time. Format: ISO 8601 timestamp (e.g. 2026-08-16T22:47:00-04:00) or HH:MM wall-clock time. Optional.",
      +  "type": "string"
      +}
    • addedInput schema / properties / wake_time
      Added value: +{
      +  "description": "Wake time / primary sleep session end time. Format: ISO 8601 timestamp (e.g. 2026-08-17T06:21:00-04:00) or HH:MM wall-clock time. Optional.",
      +  "type": "string"
      +}
  4. First observed

TDQS

A4/5.0
Behavior4/5

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

Beyond the annotations, the description discloses upsert behavior ('One row per date, updated on repeat'), the manual-source tagging rule that reserves wearable providers for auto-sync, and hard constraints (naps under 3 hours, never invent a time, naps never add to overnight totals). The upsert-per-date statement sits in mild tension with idempotentHint=false, but it describes data merging rather than claiming the call is a no-op repeat, so it reads as added nuance rather than a contradiction.

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 one-sentence purpose, then organized under short labeled blocks (DATA COLLECTION, INFER, NAPS) that an agent can scan. A few items restate schema defaults ('default today', the 1-10 score conversion), which is minor waste in an otherwise dense definition.

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 ten-field write tool with an output schema and full annotation coverage, the definition covers asking behavior, inference, nap semantics, and repeat-call merging. The remaining gap is how a same-date nap coexists with 'one row per date' for the overnight entry, which the agent would have to guess.

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 schema already carries the baseline for all ten fields. The description still adds value the schema lacks: infer the date rather than ask, the nap-specific requirement of start and/or end plus duration, and the 3-hour nap cap. The DATA COLLECTION prompt also tells the agent what to ask when numeric fields are absent.

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?

The opening sentence names a specific verb and resource ('Log an overnight sleep entry or a separate nap') and immediately scopes it to a concrete event from a tracker or recall. It clearly separates the nap path from the overnight path, but it never names a read-side sibling (list_sleep, show_sleep_detail) to contrast the write operation against.

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?

Explicit when-to-use and when-not-to-use: questions, habit mentions, or hypotheticals alone produce no write, and only a concrete sleep event qualifies. Nap vs overnight routing is spelled out. What is missing is any named alternative tool for the no-write cases (e.g., pointing question-askers at list_sleep or show_sleep_detail).

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.