Skip to main content
Glama

Find the commit that broke a test

bisect-failure
Idempotent

Find the commit that broke a test by binary-searching git history between a good and bad commit, running the test in a temporary worktree so your checkout stays untouched.

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.

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. Addedv0.6.1

TDQS

A4.5/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false, destructiveHint=false, idempotentHint=true, openWorldHint=true, but the description adds important behavior not in annotations: it runs in a temporary worktree so 'your checkout is untouched', and it reports the first bad commit with diff summary and failure. It could still mention cost/duration or that it requires a git repo with runnable tests, hence 4 rather than 5.

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, front-loaded with the core action and results, and the second sentence packs the semantics of defaults and worktree isolation without waste. Every clause earns its place.

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?

An output schema exists, so return-value detail is not required, and the description already says what is reported (first bad commit, diff summary, failure). Combined with rich parameter descriptions and annotations, an agent has enough to call this correctly and understand its side effects.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description still adds meaning beyond schema: it explains where the 'good' default comes from (newest commit where run history saw the test pass) and implies the scope of the search. The schema already covers the remaining parameters, so this is appropriately above baseline but not exhaustive.

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 goal ('find the commit that broke a test') and explains the mechanism: binary-search git history between good and bad commits, running the test in a temporary worktree. This is clearly distinguishable from siblings like get-failure (report lookup) or analyze-history (history analysis).

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 clear usage context: 'repeat' should be raised for flaky failures, 'good' defaults to the newest passing commit from run history, and the schema description prefers grep over :line. It does not explicitly name alternatives (e.g., analyze-history or diagnose-flaky) or say when not to use it, so it falls just short of a 5.

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