Skip to main content
Glama

Metric and sample-size movement

real_or_sampling
Read-onlyIdempotent

Determine whether a metric's latest departure persists after adjusting for its historical relationship with sample size. Use with aligned metric and denominator arrays; needs at least ten pairs.

Instructions

Review whether the latest numeric metric departure persists after accounting for its historical linear association with measurement sample size. Use when both a dashboard metric and its coverage denominator are available; choose did_it_change when no denominator is known. Requires at least ten aligned pairs; shorter valid arrays return NOT_ENOUGH_HISTORY. The latest pair is excluded from the historical fit. Returns verdict, assessment, reading and, when estimable, metric_delta in input units, standardized departures, sample_size_change_pct as a percent of the historical median, fit and departure_after_conditioning. Prefer assessment/validity over legacy REAL or SAMPLING_ARTIFACT labels: linear association neither proves a sampling cause nor excludes confounding. Constant or weakly related histories can return UNCLEAR and null standardized values. Unequal array lengths or nonpositive sample sizes return a tool error.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
valuesYesChronological metric readings in consistent units, one per sample_sizes entry. At least 10 aligned pairs are needed; all earlier pairs form the reference for the latest reading.
sample_sizesYesPositive measurement denominators aligned one-for-one with values. Equal array length is required. Zero coverage is missing data, not a valid denominator; economic trading volume is not measurement coverage.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
fitNoHistorical linear association, when estimable.
errorNoValidation or computation failure message; inspect MCP isError or the HTTP status.
methodNoDescriptive denominator-conditioning method.
caveatsNoOrdered statements or identifiers.
n_pairsNoNumber of aligned metric/measurement-denominator pairs.
readingNoExplanation and limits of the result.
verdictNoLegacy descriptive result code.
validityNoDescriptive assessment, not a probability or statistical certificate.
guaranteeNoNo statistical or market-performance guarantee is made.
is_causalNoAssociation does not establish causality.
assessmentNoPreferred interpretation of the legacy verdict.
metric_nowNoLatest metric in input units.
metric_deltaNoLatest metric minus historical median, in input units.
sample_size_nowNoLatest declared measurement denominator.
metric_departureNoRobust standardized latest metric departure. Null means unavailable or not applicable, never zero.
sample_size_departureNoRobust standardized denominator departure. Null means unavailable or not applicable, never zero.
zero_reference_spreadNoHistorical metric MAD is zero.
sample_size_change_pctNoDenominator change as percent of its historical median.
denominator_extrapolationNoLatest denominator falls outside the historical range.
departure_after_conditioningNoRobust standardized latest residual after linear conditioning. Null means unavailable or not applicable, never zero.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.4.3
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "assessment": {},
      +      "caveats": {},
      +      "denominator_extrapolation": {},
      +      "departure_after_conditioning": {},
      +      "fit": {},
      +      "guarantee": {},
      +      "is_causal": {},
      +      "method": {},
      +      "metric_delta": {},
      +      "metric_departure": {},
      +      "metric_now": {},
      +      "n_pairs": {},
      +      "reading": {},
      +      "sample_size_change_pct": {},
      +      "sample_size_departure": {},
      +      "sample_size_now": {},
      +      "validity": {},
      +      "verdict": {},
      +      "zero_reference_spread": {}
      +    },
      +    "required": [
      +      "n_pairs",
      +      "validity",
      +      "guarantee",
      +      "is_causal",
      +      "method",
      +      "caveats",
      +      "verdict",
      +      "assessment",
      +      "reading"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "description": "Existing tool-error payload; no successful result fields are implied.",
      +    "properties": {
      +      "error": {
      +        "description": "Validation or computation failure message; inspect MCP isError or the HTTP status.",
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "error"
      +    ],
      +    "type": "object"
      +  }
      +]
    • changedOutput schema / description
      Previous value: -"Tool-specific result object described in each tool's description. Check status/ok/state, reading, validity and limits before using numbers. MCP returns this object in structuredContent and JSON text; invalid input returns isError=true with an error field. No tool fetches sources or executes trades."New value: +"Short histories omit departure/fit fields; later branches retain only quantities that were computed. Tool errors retain the separate error-message shape."
    • addedOutput schema / properties
      Added value: +{
      +  "assessment": {
      +    "description": "Preferred interpretation of the legacy verdict.",
      +    "enum": [
      +      "insufficient_history",
      +      "no_supported_departure",
      +      "departure_from_zero_spread",
      +      "denominator_explanation_unidentified",
      +      "weak_linear_association",
      +      "consistent_with_denominator_association",
      +      "departure_survives_linear_conditioning"
      +    ],
      +    "type": "string"
      +  },
      +  "caveats": {
      +    "description": "Ordered statements or identifiers.",
      +    "items": {
      +      "description": "One retained statement or identifier.",
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  "denominator_extrapolation": {
      +    "description": "Latest denominator falls outside the historical range.",
      +    "type": "boolean"
      +  },
      +  "departure_after_conditioning": {
      +    "anyOf": [
      +      {
      +        "description": "Robust standardized latest residual after linear conditioning.",
      +        "type": "number"
      +      },
      +      {
      +        "type": "null"
      +      }
      +    ],
      +    "description": "Robust standardized latest residual after linear conditioning. Null means unavailable or not applicable, never zero."
      +  },
      +  "error": {
      +    "description": "Validation or computation failure message; inspect MCP isError or the HTTP status.",
      +    "type": "string"
      +  },
      +  "fit": {
      +    "additionalProperties": false,
      +    "description": "Historical linear association, when estimable.",
      +    "properties": {
      +      "correlation": {
      +        "description": "Historical linear correlation, rounded to three decimals.",
      +        "type": "number"
      +      },
      +      "intercept": {
      +        "description": "Metric units.",
      +        "type": "number"
      +      },
      +      "slope": {
      +        "description": "Metric units per denominator unit.",
      +        "type": "number"
      +      }
      +    },
      +    "required": [
      +      "slope",
      +      "intercept",
      +      "correlation"
      +    ],
      +    "type": "object"
      +  },
      +  "guarantee": {
      +    "description": "No statistical or market-performance guarantee is made.",
      +    "type": "null"
      +  },
      +  "is_causal": {
      +    "const": false,
      +    "description": "Association does not establish causality.",
      +    "type": "boolean"
      +  },
      +  "method": {
      +    "description": "Descriptive denominator-conditioning method.",
      +    "type": "string"
      +  },
      +  "metric_delta": {
      +    "description": "Latest metric minus historical median, in input units.",
      +    "type": "number"
      +  },
      +  "metric_departure": {
      +    "anyOf": [
      +      {
      +        "description": "Robust standardized latest metric departure.",
      +        "type": "number"
      +      },
      +      {
      +        "type": "null"
      +      }
      +    ],
      +    "description": "Robust standardized latest metric departure. Null means unavailable or not applicable, never zero."
      +  },
      +  "metric_now": {
      +    "description": "Latest metric in input units.",
      +    "type": "number"
      +  },
      +  "n_pairs": {
      +    "description": "Number of aligned metric/measurement-denominator pairs.",
      +    "minimum": 0,
      +    "type": "integer"
      +  },
      +  "reading": {
      +    "description": "Explanation and limits of the result.",
      +    "type": "string"
      +  },
      +  "sample_size_change_pct": {
      +    "description": "Denominator change as percent of its historical median.",
      +    "type": "number"
      +  },
      +  "sample_size_departure": {
      +    "anyOf": [
      +      {
      +        "description": "Robust standardized denominator departure.",
      +        "type": "number"
      +      },
      +      {
      +        "type": "null"
      +      }
      +    ],
      +    "description": "Robust standardized denominator departure. Null means unavailable or not applicable, never zero."
      +  },
      +  "sample_size_now": {
      +    "description": "Latest declared measurement denominator.",
      +    "type": "number"
      +  },
      +  "validity": {
      +    "const": "descriptive",
      +    "description": "Descriptive assessment, not a probability or statistical certificate.",
      +    "type": "string"
      +  },
      +  "verdict": {
      +    "description": "Legacy descriptive result code.",
      +    "enum": [
      +      "NOT_ENOUGH_HISTORY",
      +      "NO_MOVE",
      +      "UNCLEAR",
      +      "SAMPLING_ARTIFACT",
      +      "REAL"
      +    ],
      +    "type": "string"
      +  },
      +  "zero_reference_spread": {
      +    "description": "Historical metric MAD is zero.",
      +    "type": "boolean"
      +  }
      +}
  2. Changed3 schema fields changedv0.4.3-glama.1
    • addedInput schema / properties / sample_sizes / description
      Added value: +"Positive measurement denominators aligned one-for-one with values. Equal array length is required. Zero coverage is missing data, not a valid denominator; economic trading volume is not measurement coverage."
    • addedInput schema / properties / values / description
      Added value: +"Chronological metric readings in consistent units, one per sample_sizes entry. At least 10 aligned pairs are needed; all earlier pairs form the reference for the latest reading."
    • addedOutput schema / description
      Added value: +"Tool-specific result object described in each tool's description. Check status/ok/state, reading, validity and limits before using numbers. MCP returns this object in structuredContent and JSON text; invalid input returns isError=true with an error field. No tool fetches sources or executes trades."
  3. Changed8 schema fields changedv0.4.1
    • removedInput schema / properties / sample_sizes / description
      Removed value: -"the denominator behind each reading, same order and length"
    • addedInput schema / properties / sample_sizes / items / exclusiveMinimum
      Added value: +0
    • addedInput schema / properties / sample_sizes / maxItems
      Added value: +2048
    • addedInput schema / properties / sample_sizes / minItems
      Added value: +1
    • removedInput schema / properties / values / description
      Removed value: -"the metric's history, oldest first"
    • addedInput schema / properties / values / maxItems
      Added value: +2048
    • addedInput schema / properties / values / minItems
      Added value: +1
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  4. First observedv0.1.2

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only establish that this is a safe, idempotent read. The description goes well beyond that: the latest pair is excluded from the fit, short valid arrays return NOT_ENOUGH_HISTORY, constant or weakly related histories can return UNCLEAR with null standardized values, and unequal lengths or nonpositive sample sizes raise a tool error. These are exactly the failure modes an agent needs to anticipate.

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?

Purpose and usage are front-loaded, then behavior, then return fields, then edge cases, in a logical order with no filler sentences. It is dense and long for a two-parameter tool, and the return-value sentence partially duplicates the output schema, which costs it a point.

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?

Covers preconditions, the excluded observation, error and degenerate-result semantics, interpretation caveats, and the sibling alternative. With an output schema present the description need not explain return values, yet its brief list does no harm and the definition is complete for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and the schema already documents chronology, one-for-one alignment, positivity and the trading-volume caveat. The description reinforces the ten-pair minimum and the equal-length requirement but adds little parameter-level meaning the schema does not already carry, so the baseline 3 applies.

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 first sentence names a specific operation (test whether the latest metric departure survives conditioning on sample size) with the exact resource, and the second sentence explicitly contrasts it with the sibling did_it_change. An agent can distinguish it from did_it_change, forecast_next and which_metrics_matter without opening any schema.

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

Usage Guidelines5/5

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

States the selection condition directly: use when both a metric and its coverage denominator exist, otherwise use did_it_change. It also adds a hard precondition (at least ten aligned pairs) and a preference note on interpreting assessment/validity over the legacy REAL or SAMPLING_ARTIFACT labels, so both when-to-use and when-not-to-use are covered.

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