Skip to main content
Glama

flaky_check

Run one test 2-20 times in fresh processes to detect flakiness. Reports pass/fail pattern, failure rate, verdict, and first failure details.

Instructions

Run ONE test n times (2-20, each a fresh process) and report the pass/fail pattern.

Returns pattern like "PPFPP" (P pass, F fail, S skipped, T timeout), counts, a verdict (flaky | stable_pass | consistently_failing | inconclusive), the failure rate, and the first failure's details. Worst case it takes n x timeout seconds. A test that is only flaky when run with others (ordering, parallelism, shared state) can pass here; check that with run_tests on the surrounding file.

test_id: exact id from run_tests/list_tests (pytest: path::Class::test[param]; jest/vitest: path/file.test.js::full test name; unittest: dotted name).

Input Schema

NameRequiredDescriptionDefault
nNo
pathYes
pythonNo
runnerNo
test_idYes
timeoutNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/5

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

No annotations are supplied, so the description carries the full burden and does it well: it discloses process isolation per run, the n range (2-20), the worst-case cost ('n x timeout seconds'), the verdict taxonomy (flaky | stable_pass | consistently_failing | inconclusive), and that failure details for the first failure are included. It also warns about a false-negative mode (passing here despite order-dependent flakiness).

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?

Front-loaded with the action and the return shape, then cost, then the false-negative caveat, then the id format. Dense but nearly every sentence earns its place; the verdict enumeration is slightly redundant with the output schema but still aids interpretation.

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?

For a 6-parameter test-execution tool with an output schema, the description covers the essential contract: what it runs, how many times, what it returns, and how long it can take. The remaining gap is what 'path' and 'runner'/'python' mean operationally (project root vs file path, runner override semantics).

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 0%, so the description must compensate; it does so strongly for test_id (exact id formats for pytest, jest/vitest, unittest) and gives the n range plus the timeout relationship implicitly via the cost formula. However, path, python, and runner are never explained, leaving half the parameters undocumented in both schema and description.

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?

States a specific verb and scope: 'Run ONE test n times... and report the pass/fail pattern', with 'ONE' and 'fresh process' making it distinct from suite-level siblings. The named alternative (run_tests) further separates it from run_tests/rerun_failed.

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?

Explicitly routes an important adjacent case: a test that is only flaky under ordering/parallelism/shared state 'can pass here; check that with run_tests on the surrounding file.' That is real when-to-use-which guidance. It stops short of stating hard preconditions (e.g., when to skip flaky_check entirely), so not a 5.

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