Skip to main content
Glama

Compute derived metrics

compute_metrics

Computes derived quantities on an uploaded recording: cheaper than a full analysis when a number is all that is needed. Each call counts one unit of the key's monthly allowance, a repeated call included.

Each result is {"status": "ok", "value": ...} or {"status": "unavailable", "error": ..., "message": ...}. A metric whose requirements are unmet is refused with the reason, never computed on inadequate input and never returned as a bare null.

  • substrate_summary: the headline FATMAX numbers for about a sixth of the full substrate analysis. fatmax_found false means fat oxidation was still climbing at one end of the range, so FATMAX lies outside what the protocol covered (a fact about the protocol, not a missing value). steady_state false means the test was a ramp: FATMAX reads high and is not comparable with a graded test. windows_above_rer_one counts the windows where the fat number is an upper bound, because above RER 1.0 exhaled CO2 carries a non-metabolic part.

  • ve_vco2_slope: a profile over the first 25/50/75/100 % of exercise, not one number, because a slope that climbs across a test is a different finding from a flat one.

  • phases: rest, warm-up, exercise and recovery, inferred from the signals with an error of tens of seconds, so no boundary is exact. An absent rest phase is an answer, not a failure.

  • gas_quality and sampling_adequacy: whether the recording can support a measurement at all.

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": {
      "cpet_id": "<cpet_id>",
      "metrics": "<metrics>"
    },
    "name": "compute_metrics"
  }
}

Input Schema

NameRequiredDescriptionDefault
cpet_idYesHandle from upload_cpet, create_upload or get_sample_cpet.
metricsYesNames from list_metrics, e.g. ["vo2max", "ve_vco2_slope", "gas_quality", "phases"].

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / cpet_id / description
      Added value: +"Handle from upload_cpet, create_upload or get_sample_cpet."
    • addedInput schema / properties / metrics / description
      Added value: +"Names from list_metrics, e.g. [\"vo2max\", \"ve_vco2_slope\", \"gas_quality\", \"phases\"]."
  2. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations say only readOnlyHint=false, idempotentHint=false and destructiveHint=false; the description goes well beyond by disclosing that each call consumes one unit of the monthly allowance, repeated calls included, which materially explains the non-idempotent hint. It also documents the exact result envelope (status ok/unavailable) and the refusal contract — unmet requirements are rejected with a reason, never computed on bad input or returned as bare null.

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?

The cost and return-contract facts are front-loaded in two short paragraphs, then the per-metric caveats are scannable bullets. Each sentence carries information an agent would otherwise get wrong — no filler or restatement of the name.

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 and no annotation detail, the description does the heavy lifting: return envelope, refusal semantics, quota cost and interpretive caveats are all covered. The gap is that six enum values (vo2max, vemax, rermax, o2_pulse, landmarks, clock_integrity) get no explanation, and landmarks/clock_integrity are not self-evident from their names.

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 would be 3, but the bullets explain what selecting each metric actually yields and how to read its sentinel values (fatmax_found false means out of protocol range, steady_state false means a ramp test, absent rest phase is an answer). That adds real meaning to the `metrics` enum choices rather than restating the schema.

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?

Specific verb and object: "Computes derived quantities on an uploaded recording," with the positioning line "cheaper than a full analysis when a number is all that is needed" implicitly contrasting it with the analyze_* siblings. It never names those siblings, so the differentiation is inferential rather than explicit.

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?

"Cheaper than a full analysis when a number is all that is needed" gives a clear selection rule (quick number vs. full analysis) and the quota note adds a cost consideration for repeated calls. It stops short of explicitly naming the alternative tool or stating when-not to use it.

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