Skip to main content
Glama
PAP Analytics MCP

PAP Analytics MCP

by drew2323

segment_stats

Computes min, p5, p50, mean, p95, max, and coverage for selected PAP channels and events within a specified therapy-day time window.

Instructions

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).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "date": "<date>",
      "start": "<start>",
      "end": "<end>"
    },
    "name": "segment_stats"
  }
}

Input Schema

NameRequiredDescriptionDefault
endYes
dateYes
startYes
channelsNo
device_idNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.6

TDQS

A3.5/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the returned statistics and clarifies that times are local within the therapy day, which is genuinely useful behavioral context. It does not say whether the operation is read-only in effect, how channels are defaulted when omitted, or what happens with sparse/empty windows.

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?

One dense sentence that front-loads the return metrics and then the time-window semantics. No filler, though the example is packed into the same sentence rather than separated, and the optional parameters go unmentioned.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values needn't be spelled out. But with five parameters, no annotations, and zero schema description coverage, an agent still lacks meaning for channels and device_id and any indication of how coverage/units are expressed. Adequate for the core time-window call, incomplete around the optional filters.

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 description coverage is 0% with five parameters, so the description must compensate. The inline example establishes the date format and the HH:MM time format for start/end, which the bare 'string' titles do not convey. Channels and device_id remain undocumented, which keeps it short of a 5.

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 (statistics of channels and events) and enumerates the exact metrics returned (min/p5/p50/mean/p95/max, coverage). This separates it from plotting siblings like plot_segment, though it does not name any sibling explicitly.

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?

The worked example (date=2026-11-08 start=02:00 end=02:30) implies the intended use: a narrow time-window aggregate. However, there is no explicit when-to-use guidance versus alternatives such as night_summary, plot_segment, or compare_periods, and no stated exclusions.

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