Skip to main content
Glama

Find flaky tests

find_flaky_tests
Read-only

Detect flaky tests that flip between pass and fail across CI runs. Returns a flakiness score, timeline, failure signatures and a suggested fix, excluding systemic outages that can mimic flakiness.

Instructions

Detect flaky tests: tests that flip between pass and fail across runs. Failures caused by a systemic outage in a single run (same error hitting 3+ tests) are excluded so outages don't masquerade as flakiness. Returns score, timeline, failure signatures and a suggested fix.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
last_nNoOnly consider the most recent N runs (default: all runs)
min_flipsNoMinimum pass↔fail transitions (default 3)
min_failuresNoMinimum failures to be considered (default 2)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

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 openWorldHint=false, so safety and locality are covered. The description adds meaningful behavior beyond annotations by explaining the outage-exclusion heuristic and listing the returned artifacts: score, timeline, failure signatures, and suggested fix.

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 definition is three tight sentences. It front-loads the core purpose, then adds the important exclusion rule and return summary without repetition or filler.

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?

Although there is no output schema, the description names the main returned components and explains the key filtering logic. Combined with fully documented parameters and read-only annotations, this is nearly complete, with only minor gaps around output structure and scoring details.

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 last_n, min_flips, and min_failures are already documented with ranges and defaults. The description adds no additional parameter-level guidance, which is acceptable but does not exceed the schema baseline.

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 gives a specific verb and resource: detect flaky tests, defined as tests that flip between pass and fail across runs. It also narrows the concept by excluding systemic-outage failures, which separates the tool from generic failure-cluster or regression tools.

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?

Usage is implied: call this when looking for flaky tests rather than general failures. However, it does not explicitly say when to prefer this over siblings such as get_test_history, get_failure_clusters, or detect_regressions.

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