Skip to main content
Glama
PAP Analytics MCP

PAP Analytics MCP

by drew2323

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault

No arguments

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

PAP therapy analytics. Read pap://glossary first. Analytical output only, not a diagnosis. Discuss clinical questions with the treating physician.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
list_devicesA

Known devices with their data range and the time of the last ingest.

list_nightsB

One row per night (usage, AHI device+derived, events, leak/pressure p95, oximetry flag). Default: the last 14 days of data. Dates: YYYY-MM-DD, last, yesterday.

night_summaryB

Detail of one night: sessions, mask-off gaps, events, device vs derived metrics, channel statistics, settings in effect and oximetry. date = YYYY-MM-DD or last.

get_eventsC

Events in a window of the therapy day (default: whole night). start/end are HH:MM within the therapy day or ISO datetimes; types filters by canonical event type.

segment_statsA

Statistics (min/p5/p50/mean/p95/max, coverage) of channels and the events inside a time window, e.g. date=2026-11-08 start=02:00 end=02:30 (local time within the therapy day).

get_signalC

A channel downsampled to at most max_points (hard cap 2000) buckets of min/mean/max. flow and pressure_hr only for windows up to 30 min.

get_signalsA

Raw samples of several channels (e.g. flow, pressure_hr, mask_pressure, pressure, spo2) on ONE time grid, no aggregation and no interpolation. The grid step is that of the finest channel (25 Hz -> 0.04 s); a slower channel has its real sample on matching rows and null elsewhere. Row i is at start + i * step_s (no time list). Limit: 2000 rows (80 s with a 25 Hz channel; slow channels alone can span much longer). For longer windows use get_signal (aggregated).

oximetry_summaryB

SpO2/pulse metrics (mean, min, T90, ODI3/4, pulse) with artefact filtering and the desaturation list for a night or a window. available=false when there is no valid SpO2.

disturbance_summaryC

Sleep disturbances beyond AHI for a night or a window: measured (pulse rate response to events, rapid pulse rises with their breathing response, hypoxic burden, flow limitation, calm vs restless breathing, inspiratory flow shape NED/Glasgow Index) and inferred (possible autonomic arousals, RERA candidates from device flow limitation and from NED) metrics, flow_shape_by_ps (flow shape split by pressure support 0 / > 0), plus timestamped findings (incl. restless breathing periods) and per-event pulse responses. Inferred items are not scored arousals/RERAs; calm/restless is not sleep staging.

disturbance_trendB

Nightly disturbance metrics (PRR, pulse-rise index, hypoxic burden, flow limitation, calm-breathing share, flow shape: NED and Glasgow Index, inferred arousal, NED RERA and RERA-candidate indices) one row per night, with units/methods and the mean per metric. Default: the last 14 days of data. Null = signal missing that night.

compare_periodsA

Mean nightly metrics for period A and B with absolute and relative delta (B − A). include_disturbances=true adds the nightly disturbance_trend metrics (pulse, flow limitation, breathing stability, flow shape NED/Glasgow, RERA candidates), e.g. to compare nights before and after a pressure change; slower (about 1-3 s per night).

get_settingsB

Device settings: those in effect on date, or the full history of change points.

find_anomaliesB

Parts of a night worth a look (event clusters, large leak, desaturations, pressure at max, low ventilation, mask-off gaps, metric outliers vs the last 14 nights), most severe first, each with a plain-English reason and a suggested_call to inspect it.

plot_segmentA

PNG plot of a night segment (pressure, leak, minute ventilation, SpO2 by default) with events as shaded bands. Use for a visual check of a window found by find_anomalies.

Prompts

Interactive templates invoked by user choice

NameDescription
nightly_reviewReview one night.

Resources

Contextual data attached and managed by the client

NameDescription
glossaryChannels, units, event types, provenance and the therapy-day definition.
devices_resource

TDQS

A3.5/5.0

Scored across 14 tools

Disambiguation4/5

Most tools target clearly distinct resources: nights, devices, events, settings, oximetry, disturbances, anomalies, and plotting are each covered by one obvious tool. The riskiest pair is `get_signal` vs `get_signals` (downsampled single channel vs raw multi-channel on a shared grid), and the three '*_summary' tools (night, disturbance, oximetry) could be initially confused, though descriptions explicitly separate them and cross-reference the right alternative.

Naming Consistency4/5

Names follow two coherent families: verb_noun actions (get_signal, get_signals, get_events, get_settings, list_nights, list_devices, compare_periods, find_anomalies, plot_segment) and noun_qualified analytical views (night_summary, oximetry_summary, disturbance_summary, disturbance_trend, segment_stats). The get_/list_ prefixing is predictable, with the only real deviation being near-identical singular/plural names and mixed noun-only vs verb-prefixed retrieval tools.

Tool Count5/5

At 14 tools the set sits comfortably in the well-scoped range, and each tool covers a distinct layer of the analytics workflow: discovery (devices, nights), drill-down (night_summary, events, segment_stats), signal access (get_signal/get_signals), specialized domains (oximetry, settings, disturbances), and synthesis (compare_periods, find_anomalies, plot_segment). No tool appears redundant or token-padding.

Completeness4/5

The read-only analytics surface is broad: device/night discovery, per-night detail, event and window statistics, aggregated and raw signal access, oximetry, settings history, disturbance trends, period comparison, anomaly triage, and visual plotting. Minor gaps exist—no consolidated long-range adherence/compliance rollup or export of results, and anomaly findings can only be followed up through generic segment tools rather than a dedicated 'explain finding' call—but agents can work around these via compare_periods, list_nights, and segment_stats.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues