Skip to main content
Glama

flaky_quarantine_analyze

Read-onlyIdempotent

Analyze historical JUnit XML test runs to statistically separate broken tests from flaky ones and generate quarantine recommendations for intermittent CI failures.

Instructions

Analyzes multiple historical JUnit XML test run reports using two-state Markov chain transition matrices to statistically separate genuinely broken tests from nondeterministic flaky tests. Generates quarantine recommendations and test stability manifests. Use when: Triage of intermittent CI/CD pipeline failures, isolating nondeterministic test suites, and calculating test failure probability. Do not use when: Auditing unified git diffs or parsing database dumps. Alternative: Use agentpr_guard_audit for git security audits, or sqltwin_stream_anonymize for database anonymization. Execution: Runs locally in-memory (<10ms), read-only, idempotent, zero network calls, zero telemetry, air-gapped deterministic.

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": {
      "junitXmlReports": "<junitXmlReports>"
    },
    "name": "flaky_quarantine_analyze"
  }
}

Input Schema

NameRequiredDescriptionDefault
licenseKeyNoOptional TopAI Sovereign Pro offline license key (or set TOPAI_LICENSE_KEY env variable).
junitXmlReportsYesArray of JUnit XML report strings representing chronological CI test runs.

Output Schema

NameRequiredDescriptionDefault
summaryYesAggregated suite statistics: total tests, failure rate, and transition counts.
stableTestsYesList of tests verified as deterministic and reliable.
quarantinedTestsYesList of tests classified as statistically flaky requiring quarantine.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.0.6
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / junitXmlReports / description
      Previous value: -"Array of JUnit XML report strings"New value: +"Array of JUnit XML report strings representing chronological CI test runs."
    • addedInput schema / properties / licenseKey
      Added value: +{
      +  "description": "Optional TopAI Sovereign Pro offline license key (or set TOPAI_LICENSE_KEY env variable).",
      +  "type": "string"
      +}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "quarantinedTests": {
      +      "description": "List of tests classified as statistically flaky requiring quarantine.",
      +      "type": "array"
      +    },
      +    "stableTests": {
      +      "description": "List of tests verified as deterministic and reliable.",
      +      "type": "array"
      +    },
      +    "summary": {
      +      "description": "Aggregated suite statistics: total tests, failure rate, and transition counts.",
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "summary",
      +    "quarantinedTests",
      +    "stableTests"
      +  ],
      +  "type": "object"
      +}
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

The annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so repeating 'read-only, idempotent, zero network calls' earns no credit. What the description does add beyond structured data is execution profile — in-memory, sub-10ms, air-gapped determinism — which tells the agent it can call this cheaply and repeatedly. It does not note the licensing requirement for the licenseKey path, which is a minor omission.

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 is front-loaded in the first sentence, then usage, exclusions, alternatives, and execution traits follow in a scannable order. There is minor waste: the 'do not use' examples (git diffs, database dumps) are implausible inputs chosen mainly to host the sibling redirects, and the execution sentence partly restates the annotations.

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?

An output schema exists, so return values need not be explained, and the input schema fully documents both parameters. What remains — what the tool does, when to reach for it, when not to, what to use instead, and its cost/safety profile — is all present.

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 coverage is 100% and both parameters are documented in the schema, so the baseline applies. The description reinforces the key semantic constraint — that `junitXmlReports` must be 'multiple historical' reports — but adds no ordering, size, or license-key guidance beyond what the schema already states.

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 names a specific verb (analyzes), a specific resource (multiple historical JUnit XML test run reports), the technique used (two-state Markov chain transition matrices), and the outputs produced (quarantine recommendations, stability manifests). This is enough to distinguish it cleanly from all eight sibling tools, none of which touch test reports.

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?

It has explicit 'Use when' triggers (intermittent CI/CD failures, nondeterministic suites, failure-probability calculation), explicit 'Do not use when' exclusions (git diff audits, database dumps), and named alternatives (`agentpr_guard_audit`, `sqltwin_stream_anonymize`). Nothing about tool selection is left to inference.

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