Skip to main content
Glama

Check a test fix (heal guard)

check-test-change
Idempotent

Verifies changed Playwright spec files against a git ref or proposed edit to block weakened tests, deleted assertions, skipped tests, and .only; warns on weaker matchers and swallowed errors.

Instructions

Heal guard: check that changed tests were not made to pass by checking less. Compares spec files with a git ref (default HEAD = uncommitted changes) or one proposed file (file + after). BLOCK on deleted assertions, skipped/removed tests or .only; WARN on weaker matchers, waitForTimeout, force: true, swallowed errors, raised timeouts or retries. Run it after any AI fix, before committing.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "check-test-change"
  }
}

Input Schema

NameRequiredDescriptionDefault
baseNoGit ref to compare with: 'HEAD' (default: uncommitted changes), 'origin/main' (the whole branch)
fileNoWith after: the spec file a fix would change
afterNoWith file: the fix's full new file content, checked before it is written
filesNoOnly these files (default: every changed spec file and playwright config)
runtimeNoAlso run each changed TS/JS spec in its old and new version and compare how many assertions actually ran per test (catches early returns and skipped branches the code scan cannot see)
projectRootNoProject directory (default: server root)

Output Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 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 / after / maxLength
      Removed value: -1000000
    • removedInput schema / properties / files / maxItems
      Removed value: -200
    • addedInput schema / properties / runtime
      Added value: +{
      +  "description": "Also run each changed TS/JS spec in its old and new version and compare how many assertions actually ran per test (catches early returns and skipped branches the code scan cannot see)",
      +  "type": "boolean"
      +}
  2. Addedv0.7.0

TDQS

A4.3/5.0
Behavior4/5

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

Adds real behavioral context beyond the annotations by disclosing a severity model: BLOCK on deleted assertions/skipped tests/.only, WARN on weaker matchers, waitForTimeout, force:true, swallowed errors, raised timeouts. Annotations already cover safety (destructive=false, idempotent=true); the description's contribution is the blocking-vs-warning classification, though it does not say what a BLOCK actually does to the caller's workflow.

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 guard's purpose, then modes, then severity tiers, then when to run — a logical order with no filler. It is dense to the point of being packed into one paragraph, which costs a point on readability.

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?

Covers purpose, both invocation modes, defaults, severity semantics, and when to call it; an output schema exists so return shape needn't be explained. Minor gap: nothing says what happens if the check is inconclusive or how a BLOCK surfaces to the agent.

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 100%, so the baseline is 3; the description still adds meaning by explaining the two mutually exclusive modes (base for git comparison with HEAD default, file+after for a proposed fix checked before it is written) and that the default scope is 'every changed spec file and playwright config.'

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 ('check that changed tests were not made to pass by checking less') and names the artifact domain (spec files, git ref, or a proposed file). It is clearly distinguishable from siblings like audit-tests or suggest-fix because it is a post-fix guard rather than an audit or a fix generator.

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?

Explicit timing guidance: 'Run it after any AI fix, before committing,' plus the two operating modes (git-ref comparison vs. file+after pre-write check). No explicit when-not or named sibling alternative, so it falls 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.