Skip to main content
Glama

Get Sleep

get_sleep
Read-only

Retrieve sleep data at the detail level you need: stage totals per period for multi-day trends, one row per sleep session, or every stage interval for single-night analysis. Extend ranges to cover midnight.

Instructions

Return the user's sleep at a chosen level of detail; pick the coarsest that answers the question:

  • "aggregate": stage totals per period, for multi-day questions.

  • "cycles": one row per sleep session.

  • "stages": every stage interval; single-night detail.

Sleep crosses midnight, so extend the range to cover it. Stages: 0=In Bed, 1=Asleep/Unknown, 2=Awake, 3=Light, 4=Deep, 5=REM.

Input Schema

NameRequiredDescriptionDefault
levelNoLevel of detail (see above).cycles
periodNo"aggregate" only: period length, e.g. "1d" (default) or "1w".
stagesNoOnly these stages (default: all).
end_timeYesRange end (exclusive).
time_zoneNo"aggregate" only: IANA zone for period bounds (default: the user's own).
start_timeYesRange start (inclusive).
fulcra_useridNoRetrieve data for another Fulcra user (if shared).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed24 schema fields changedv1.18.7
    • removedInput schema / properties / agg_functions
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "items": {
      -        "type": "string"
      -      },
      -      "type": "array"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "\"aggregate\" level only. E.g. \"sum\", \"mean\" (default [\"sum\"])."
      -}
    • removedInput schema / properties / clip_to_range
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "boolean"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": true,
      -  "description": "Clip results to the requested range (default True)."
      -}
    • removedInput schema / properties / cycle_gap
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "Minimum interval separating distinct cycles (e.g. \"PT2H\")."
      -}
    • changedInput schema / properties / end_time / description
      Previous value: -"Range end (exclusive). Must include tz (ISO8601)."New value: +"Range end (exclusive)."
    • addedInput schema / properties / fulcra_userid
      Added value: +{
      +  "description": "Retrieve data for another Fulcra user (if shared).",
      +  "type": "string"
      +}
    • removedInput schema / properties / gap_stages
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "items": {
      -        "type": "integer"
      -      },
      -      "type": "array"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "Stage integers treated as gaps between cycles."
      -}
    • removedInput schema / properties / merge_contiguous
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "boolean"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "\"stages\" level only. Merge adjacent same-stage samples (default True)."
      -}
    • removedInput schema / properties / merge_overlapping
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "boolean"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "\"stages\" level only. Merge overlapping stages (default True)."
      -}
    • removedInput schema / properties / mode
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "enum": [
      -        "start",
      -        "end",
      -        "split"
      -      ],
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "\"aggregate\" only. Assign by \"start\", \"end\" or \"split\" (default \"end\")."
      -}
    • removedInput schema / properties / period / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / period / default
      Removed value: -null
    • changedInput schema / properties / period / description
      Previous value: -"\"aggregate\" level only. Period length, e.g. \"1d\", \"1w\" (default \"1d\")."New value: +"\"aggregate\" only: period length, e.g. \"1d\" (default) or \"1w\"."
    • addedInput schema / properties / period / type
      Added value: +"string"
    • removedInput schema / properties / stages / anyOf
      Removed value: -[
      -  {
      -    "items": {
      -      "type": "integer"
      -    },
      -    "type": "array"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / stages / default
      Removed value: -null
    • changedInput schema / properties / stages / description
      Previous value: -"Stage integers to include (default: all)."New value: +"Only these stages (default: all)."
    • addedInput schema / properties / stages / items
      Added value: +{
      +  "type": "integer"
      +}
    • addedInput schema / properties / stages / type
      Added value: +"array"
    • changedInput schema / properties / start_time / description
      Previous value: -"Range start (inclusive). Must include tz (ISO8601)."New value: +"Range start (inclusive)."
    • removedInput schema / properties / time_zone / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • removedInput schema / properties / time_zone / default
      Removed value: -null
    • changedInput schema / properties / time_zone / description
      Previous value: -"\"aggregate\" only. IANA tz for period bounds; use the user's local one."New value: +"\"aggregate\" only: IANA zone for period bounds (default: the\nuser's own)."
    • addedInput schema / properties / time_zone / type
      Added value: +"string"
    • changedOutput schema / (root)
      Previous value: -{
      -  "properties": {
      -    "result": {
      -      "type": "string"
      -    }
      -  },
      -  "required": [
      -    "result"
      -  ],
      -  "type": "object",
      -  "x-fastmcp-wrap-result": true
      -}New value: +null
  2. Addedv1.1.0

TDQS

A4.7/5.0
Behavior5/5

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

It adds crucial domain behavior beyond annotations by explaining the data handling logic (extending the range across midnight) and providing a legend for the integer codes representing sleep stages. This level of detail significantly aids correct interpretation of the data.

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

Conciseness5/5

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

The structure is excellent, using bullet points and clear, functional language to convey complex options efficiently. Every sentence directly contributes to guiding the agent on how to invoke the tool correctly.

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?

The description is extremely thorough, covering not only the structural output (detail levels) but also the temporal data constraints (cross-midnight extension) and the underlying biological data representation (stage codes).

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?

Although schema coverage is 100%, the description adds necessary semantic depth by explaining the purpose of the 'level' enum choices and defining the specific values for the 'stages' array parameter.

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 clearly states the purpose (returning user's sleep) and immediately distinguishes its core capability: providing sleep data at three distinct, clearly defined levels of granularity ('aggregate', 'cycles', 'stages').

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 provides strong internal logic for usage, specifically detailing that 'aggregate' should be used for 'multi-day questions.' While it doesn't mention alternatives, it guides the agent on the appropriate choice of level based on the complexity of the required data.

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