Skip to main content
Glama
BobChochola

playwright-fixer-mcp

by BobChochola

Analyze and fix Playwright selector

analyze_and_fix_selector

Diagnose Playwright selector failures using error messages and screenshots, then recommend stable getByRole-based locator fixes.

Instructions

Analyze Playwright failure: require reading the full spec for context first; use error message + screenshot path (and optional DOM snapshot) to suggest a stable locator fix (getByRole preferred).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domSnapshotNoHTML snippet at failure time (e.g. from trace or snapshot)
errorMessageYesPlaywright error message or stack snippet
originalCodeNoRelevant test/spec code snippet that failed (full spec should still be read for context)
specFilePathNoFull path to the spec file (Cursor should read entire file for context before fixing)
failureContextNoFailure context: pass 'hover' | 'fill' | 'iframe' | 'default' to include the corresponding rule and instruction (default: 'default')
screenshotPathNoPath to failure screenshot (e.g. test-results/.../test-failed-1.png); analyze screenshot with error message
Behavior3/5

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

With no annotations, the description carries the transparency burden. It discloses a prerequisite (read full spec), inputs to use, and that the fix should prefer getByRole. However, it does not state whether the tool modifies files (though 'suggest' implies non-mutating), how the fix is returned, or limitations on multiple failures.

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?

The description is a single, dense sentence that front-loads the purpose. Every phrase serves a function: 'Analyze Playwright failure' states the task, 'require reading the full spec for context first' gives a prerequisite, and the rest specifies inputs and output preference. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 6 parameters, no output schema, and no annotations, the description covers the primary workflow but leaves gaps: it doesn't explain the return format, how originalCode/failureContext should be used, or what constitutes a stable locator beyond getByRole. It is adequate for a simple analysis tool but not fully comprehensive.

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 100%, so all six parameters are already described. The description adds minimal parameter-level guidance, only highlighting errorMessage, screenshotPath, and domSnapshot. It does not add semantics beyond the schema, so baseline 3 is appropriate.

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 clearly states the tool's purpose: 'Analyze Playwright failure' and 'suggest a stable locator fix'. It distinguishes from siblings by focusing on analysis and fix suggestion, whereas tools like get_playwright_fix_workflow provide workflow guidance and run_test_and_analyze_failure executes tests.

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?

The description gives explicit context: 'require reading the full spec for context first' and tells the agent to use 'error message + screenshot path (and optional DOM snapshot)'. It does not explicitly mention when not to use this tool or alternatives, but the workflow is clear enough.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/BobChochola/E2E-fixer-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server