Skip to main content
Glama

CGM hypo events

cgm_hypo_events
Read-onlyIdempotent

Detect hypoglycemia events in a CGM time window, returning each below-threshold run's duration, severity, and recovery time.

Instructions

v0.3.3 — Detect hypoglycemia events between from and to ISO dates. Returns an array of contiguous below-threshold runs lasting ≥ min_duration_minutes, each with started_at, ended_at, duration_minutes, min_glucose_mg_dl, mean_glucose_mg_dl, severity (level_1 = <70 ADA Level 1, level_2 = <54 ADA Level 2), and recovery_time_minutes (time to first reading ≥ threshold+10). Also returns total_events, total_minutes_below, mean_min_glucose, events_per_day, a summary string, and recommendations grounded in what was actually observed. window is the span REQUESTED; hours_covered, observed_window and window_truncated_by_provider state what the provider actually returned — FreeStyle Libre (LibreLink Up) caps a live read at ~12h, so a 3-day question can be answered from half a day and notes says so. "No hypos" is only true for hours_covered. MEDICAL DISCLAIMER: NOT medical advice. Do not use for treatment decisions. Hypo events should be discussed with your clinician.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
toYesISO-8601 timestamp / date of the analysis window end.
fromYesISO-8601 timestamp / date of the analysis window start.
privacy_modeNoOptional privacy mode: summary | structured | raw. summary omits device/patient identifiers when present; structured/raw return full payload.
response_formatNoOutput shape. "structured" (default) returns the full event array. "summary" omits the per-event array, keeping totals + summary + recommendations.
threshold_mg_dlNoHypo threshold in mg/dL. Default 70 (ADA Level 1).
min_duration_minutesNoMinimum contiguous-minutes-below-threshold to count as an event. Default 15.
severe_threshold_mg_dlNoSevere hypo threshold in mg/dL. Default 54 (ADA Level 2).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.6.4
  2. Removedv0.4.1
  3. First observedv0.4.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly, openWorld, idempotent, and non-destructive. The description adds substantial behavioral detail beyond those: window truncation by the provider, the caveat that 'No hypos' is only true for hours_covered, ADA level thresholds, and the recovery_time definition. It also includes a medical disclaimer. No contradiction with annotations; it enriches them significantly.

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?

The description is long but information-dense. It leads with the core purpose, then output fields, then provider caveats, and ends with the disclaimer. Each sentence earns its place — no fluff. The structure is logical, though the length might slightly challenge quick scanning. It's appropriately sized for the complexity.

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?

Without an output schema, the description fully specifies return values (event fields, totals, recommendations). It covers edge cases (window truncation, threshold interpretation, provider limits) and provides a safety disclaimer. For an agent to correctly call and interpret results, nothing essential is missing. This is as complete as it needs to be.

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. The description adds clinical meaning to parameters (e.g., threshold_mg_dl as ADA Level 1, severe_threshold as Level 2) and clarifies that `window` is the requested span while observed_window reflects actual data. It also explains how response_format and privacy_mode affect output. This goes beyond the schema's plain descriptions, justifying a 4.

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 opens with a precise verb-resource pair — 'Detect hypoglycemia events between `from` and `to` ISO dates' — and enumerates the exact output fields (started_at, severity, recovery_time_minutes, etc.). It clearly distinguishes this tool from siblings like cgm_glucose_window or cgm_time_in_range by focusing specifically on hypo events and their structure.

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?

The description provides strong context for when to use it: it handles date ranges and outputs event arrays with thresholds. It also explains provider-specific behavior (12h cap on live reads) that affects interpretation. However, it never explicitly names alternative tools or states when NOT to use it, leaving the agent to infer from sibling names. A direct 'use this instead of X' would push it to 5.

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