Skip to main content
Glama

detect_flaky_tests

Read-onlyIdempotent

Re-run selected test IDs several times to classify results as consistently failing, flaky, or passing, distinguishing real bugs from unreliable tests before failures are reported.

Instructions

Re-run specific tests runs times to tell real bugs from flaky tests.

ALWAYS use this before reporting any test failure as a bug. Pass node ids from run_tests (e.g. "tests/test_x.py::test_y"); at most 10 ids, runs clamped to 2..20. Each test runs in its own pytest process (so one bad id cannot spoil the others) and is classified as consistently_failing, flaky, passing or not_run, with pass/fail counts per run.

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": {
      "repo": "<repo>",
      "test_ids": "<test_ids>"
    },
    "name": "detect_flaky_tests"
  }
}

Input Schema

NameRequiredDescriptionDefault
repoYes
runsNo
test_idsYes
timeout_sNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already state readOnlyHint, idempotentHint, and destructiveHint=false. The description adds real behavioral context beyond them: per-test process isolation, the four classification outcomes, and per-run pass/fail counts. It does not cover the timeout or repo behavior, so it falls just short of full disclosure.

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?

It is front-loaded with the purpose, then the usage rule, then input format, then behavior and return classification. Every sentence adds distinct information, and nothing is repeated from the annotations.

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?

With no output schema, the description correctly explains the return classifications and counts. The gaps are the unmentioned repo and timeout_s parameters; otherwise it is complete for a tool of this complexity.

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 carry the parameter burden. It explains test_ids well (node-id format, example, maximum of 10) and runs (clamped to 2..20), but repo and timeout_s are never mentioned, so two of the four parameters remain undocumented.

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 opens with a specific verb and resource: 'Re-run specific tests `runs` times to tell real bugs from flaky tests.' It also distinguishes the tool from run_tests, which is identified as the source of node ids, so an agent can tell the two apart without opening either 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?

It gives an explicit, emphatic trigger: 'ALWAYS use this before reporting any test failure as a bug.' It also names where the inputs come from ('Pass node ids from run_tests') and the practical limits (at most 10 ids, runs clamped to 2..20).

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