Skip to main content
Glama

Suggest (and apply) a fix

suggest-fix
Destructive

Patch Playwright test failures by replacing drifted locators with unique matches and updating changed expected text, returning a diff and confidence before applying and verifying the fix.

Instructions

Patch a failure from the last run: a drifted locator is matched against the DOM at failure (trace, or live url) and replaced with one proven unique; changed copy gets the new expected text. Returns a diff and confidence; apply: true writes it, re-runs the test and reverts if still red. Refuses when the element is truly missing (app bug).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNoHeal against this live page instead of the trace snapshot
applyNoWrite the fix (default: diff only)
indexNo1-based failure index (default 1)
configNoplaywright.config path or 1-based index
verifyNoRe-run after applying; revert if still failing (default true)
headersNoExtra HTTP headers, e.g. Authorization
timeoutMsNoVerification run limit (default 120000)
projectRootNo
storageStateNoLogged-in session: storageState JSON inside the project, e.g. playwright/.auth/user.json
allowExpectationUpdateNoAllow applying changed expected text (can hide regressions)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.2

TDQS

A4.5/5.0
Behavior5/5

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

Annotations flag destructiveness and non-idempotency, and the description adds behavior annotations cannot express: the verify-then-revert cycle ('re-runs the test and reverts if still red'), the returned artifacts (diff and confidence), and the refusal condition for genuine app bugs. This is exactly the extra context an agent needs before invoking a destructive tool.

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?

Three dense sentences, front-loaded with the core action and repair mechanism before the apply/verify semantics and the refusal caveat. Every clause carries information, though the middle sentence packs several behaviors into one run-on structure.

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 10-param destructive tool with no output schema, the description covers the mutations, the reversion guarantee, what is returned (diff, confidence), and the refusal case. It leaves auth/session params (headers, storageState) and config/timeout handling to the schema, which is acceptable given their 90% coverage.

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 coverage is 90%, so the baseline is 3, but the description meaningfully extends key params: it explains that apply:true triggers a write plus verification with rollback, and that url heals against the live page instead of the trace snapshot — detail beyond the schema's terse 'default: diff only' and 'Heal against this live page'.

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+resource with scope: 'Patch a failure from the last run', and details the two concrete repair modes (drifted locator remap, changed expected text). This clearly separates it from siblings like get-failure (read) and run-test (execute).

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 context for use ('failure from the last run') and an explicit exclusion boundary ('Refuses when the element is truly missing (app bug)'), plus a variant path (live url vs trace). It does not name alternative siblings such as validate-selector or inspect-page for pre-healing analysis, 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.