Skip to main content
Glama
PhilipAD

MetricBridge (formerly Health Export AI)

get_sleep_sessions

Read-onlyIdempotent

Retrieve filtered sleep sessions by waking day to analyze nightly patterns and ensure consistency with daily sleep analysis. Handles duplicate sessions by collapsing them into the longer entry.

Instructions

Clustered sleep sessions from health-sessions.json with {start, end, day} filters. Sessions are attributed to the WAKING day, matching the daily cache's sleep_analysis, so the two surfaces never disagree; a split night appears as separate sessions with the same day. Duplicate copies of one night left by older app versions (sharing an end time with, or lying inside, a longer session on the same day) are collapsed to the longer one and counted in collapsedDuplicates. A session with manualInBed:true was built from an In Bed entry typed into the Health app with no asleep sample. Timestamps carry the local UTC offset at the time of the sample.

Input Schema

NameRequiredDescriptionDefault
dayNoA single waking day, YYYY-MM-DD.
endNoLast waking day (inclusive), YYYY-MM-DD.
startNoFirst waking day (inclusive), YYYY-MM-DD.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.4.0

TDQS

A4.1/5.0
Behavior5/5

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

Despite annotations covering the read-only/idempotent profile, the description adds real behavioral context: duplicate nights from older app versions are collapsed into the longer session and counted in `collapsedDuplicates`, split nights appear as separate sessions sharing a day, and timestamps carry the local UTC offset. These are non-obvious output behaviors an agent could not infer from annotations.

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 core purpose and filters, then layered with behavioral detail. It is dense and mostly earns its sentences, though it reads as a run of separate caveats rather than a structured hierarchy.

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?

With no output schema, the description must carry return-value semantics, and it does: collapsedDuplicates, separate sessions for split nights, manualInBed:true provenance, and timezone-offset timestamps. An agent has enough to interpret results correctly.

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, and the description earns extra credit by explaining that filters operate on the WAKING day and why split nights share a day. That adds interpretive meaning beyond the schema's terse 'A single waking day' phrasing.

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 resource (clustered sleep sessions from health-sessions.json) and its filters {start, end, day}, which is more precise than the name alone. It does not name or differentiate against siblings like query_health_data or get_intraday, so an agent gets the what but not the routing signal.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It implies the tool's niche by explaining the waking-day attribution and that it matches the daily cache's sleep_analysis, but there is no explicit 'use this when / use X instead' guidance for choosing between this and the other health-data tools. Usage is inferred rather than stated.

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