Skip to main content
Glama
byreshb

testing-toolkit-mcp

by byreshb

Rank tests by flakiness

flake.rank
Read-onlyIdempotent

Rank tests by flakiness using historical run data, returning scores, run counts, and explanations to identify flaky tests before retrying failures or judging if a red build is a regression.

Instructions

Runs flake-detector's scorer over the ingested run history (.flake/history.db in the repository) and returns the most flaky tests first, each with a 0-1 score, run count, the signals behind the score and a plain-language explanation. Use it before retrying a failing test or deciding whether a red build is a regression.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
topNoHow many tests to return, most flaky first
repoNoRepository root to run in; defaults to TOOLKIT_REPO

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
runsNo
testsYes
generatedAtNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.1-SNAPSHOT

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, lowering the bar. The description adds valuable behavioral context: it reads a specific database file (`.flake/history.db`), computes scores, and returns metadata including signals and explanations. It also describes output order. No contradiction with annotations.

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?

Two sentences with zero redundancy: the first sentence states the action, data source, and output in detail; the second gives a clear usage instruction. Front-loaded and efficient.

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?

The description covers purpose, output contents, and usage context. Since an output schema exists, detailed return types are unnecessary. The only minor gap is not explicitly stating that the history database must exist, but it's implied by 'ingested run history.' Overall adequate for the tool's simplicity.

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%, so the baseline is 3. The description doesn't add parameter-specific meaning beyond what the schema already documents ('top' counts, 'repo' root). It implicitly relates to ordering but that's already in the schema's parameter descriptions. The baseline applies.

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?

The description clearly states a specific verb ('runs flake-detector's scorer over the ingested run history') and a specific resource (the history database), and it lists the output (ranked tests with score, run count, signals, explanation). It doesn't explicitly differentiate from sibling tools like flake.explain or flake.quarantine.list, but the function is unambiguous enough that an agent can tell it apart.

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?

The description provides explicit usage context: 'Use it before retrying a failing test or deciding whether a red build is a regression.' This gives clear when-to-use guidance, though it doesn't mention exclusions or alternatives. That matches a 4: clear context without explicit when-not-to-use.

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