Skip to main content
Glama

Find the commit that broke a test

bisect-failure
Idempotent

Find the first git commit that broke a Playwright test by binary-searching history between good and bad commits in a temporary worktree, then report the bad commit, diff summary, and failure.

Instructions

Find the commit that broke a test: binary-search the git history between a good and a bad commit, running the test at each step in a temporary worktree (your checkout is untouched), and report the first bad commit with its diff summary and failure. good defaults to the newest commit where the run history saw the test pass.

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": {
      "test": "<test>"
    },
    "name": "bisect-failure"
  }
}

Input Schema

NameRequiredDescriptionDefault
badNoA commit or ref where it fails (default HEAD)
goodNoA commit or ref where the test passed. Defaults to the newest commit in the run history where it passed
grepNoTest title (or part of it) to run inside the file; keeps the search on one test
testYesThe failing spec file, e.g. "tests/cart.spec.ts" (a :line suffix also works, but lines move between commits; prefer grep)
configNoplaywright.config path or 1-based index
repeatNoRun the test this many times per commit; any failure marks the commit bad (default 1; raise it for a flaky failure)
projectNoPlaywright project name to run in
maxStepsNoMost commits to test besides the two ends (default 12, enough for 4,000 commits)
projectRootNoProject directory (inside a git repository); defaults to the server working directory
stepTimeoutMsNoTime limit for each test run (default 180000)

Output Schema

NameRequiredDescriptionDefault
okYesfalse when the call failed (see error) or the tests it ran failed
errorNo
stepsNo
statusNo
firstBadNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.13.0
    • removedInput schema / $schema
      Removed value: -"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -{}
    • removedInput schema / properties / test / minLength
      Removed value: -1
  2. Addedv0.6.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false, so the description's disclosure that the test runs in a temporary worktree and 'your checkout is untouched' is genuinely valuable side-effect context. It also states what is returned (first bad commit, diff summary, failure). It omits cost/duration expectations, which the schema's maxSteps and stepTimeoutMs only partially cover.

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?

A single front-loaded sentence that leads with the goal and then the mechanism, with no filler. It is dense with clauses but each carries information; slightly long for one sentence but well ordered.

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?

For a 10-parameter tool with an output schema and full schema coverage, the description supplies the mechanism, the isolation guarantee, and the return contents. Nothing an agent needs to decide to call it is missing.

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%, so every parameter is already documented, and the description's note about the good default merely restates the schema. It adds the conceptual framing of good/bad endpoints but no syntax or format detail beyond the schema, so baseline 3 applies.

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 resource ('Find the commit that broke a test') and immediately explains the mechanism (binary-search git history between good and bad commits). This clearly distinguishes it from siblings like run-test and get-failure, which execute or report rather than bisect.

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?

Gives concrete usage context: it explains the good-commit default and notes that repeat should be raised for flaky failures, which is a real when-to-use signal. It does not explicitly contrast with run-test or get-failure, so it stops short of full alternative routing.

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