Skip to main content
Glama

A Good Sign: Apple Health MCP

Get Sleep

get_sleep
Read-only

Summarize sleep samples for the authenticated user only. Sleep sessions whose date interval overlaps the query window match, including sessions spanning midnight. summary.sleep reports deduplicated elapsed time so overlapping Apple Health records are not counted twice; use it for sleep duration instead of summary.duration, which describes the source records themselves. Results are ordered by start date (newest first by default) and capped at limit (default 100, max 1000); summary.mayHaveMore reports when more samples matched. Set includeSamples to true only when raw samples are required.

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
limitNo
orderNoSort order by sample start date. desc returns the most recent samples first.desc
endDateNo
startDateNo
includeSamplesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, non-destructive, closed-world), and the description adds substantive behavior: overlap-based matching across midnight, deduplication of overlapping Apple Health records, ordering by start date, the limit cap, and the mayHaveMore signal. That is exactly the extra context annotations cannot convey.

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?

Four tight sentences, each front-loading the most decision-relevant fact: scope first, then matching semantics, then field-selection advice, then result ordering and paging. No filler or repetition of structured data beyond what serves the warning about duration.

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?

With no output schema, the description usefully names summary.sleep, summary.duration, and summary.mayHaveMore, so the agent can interpret the response. Minor gaps remain: nothing about timezone handling for the date window or what a raw sample looks like when includeSamples is true.

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 low at 20% (only order is documented), and the description compensates by explaining the window parameters' overlap matching semantics, includeSamples' cost implication, and the limit default/ceiling. It does not restate the accepted date-time format, but the semantics that matter for correct querying are present.

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?

States a specific verb and resource ("Summarize sleep samples") plus an explicit scope ("for the authenticated user only"), which an agent can act on immediately. It never names a sibling such as query_samples, though the includeSamples caveat implicitly signals the raw-sample alternative.

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 concrete conditional guidance: use summary.sleep rather than summary.duration for duration, and set includeSamples to true only when raw samples are required. It stops short of naming which sibling tool to use when raw samples are needed, leaving that routing to inference.

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.

Resources