Skip to main content
Glama
baramubarok

playwright-generate-mcp

by baramubarok

Scaffold test domain

scaffold_test_domain

Create a Domain-Driven POM structure for a Playwright feature: pages, API mocks/helpers, fixture, data factory, spec, and diagnostics. Use before writing new E2E tests to keep structure consistent.

Instructions

Scaffold the Domain-Driven POM structure for a feature: pages, mock API handlers, real API helpers, custom fixture, dynamic data factory and a spec, plus a shared diagnostics fixture (tests/e2e/support) that records browser console/page/network events. The spec is an explicit skeleton: its tests are test.fixme (skipped) and marked @mcp-skeleton until the TODOs are implemented. Always use this before writing new tests to ensure a consistent structure.

Input Schema

NameRequiredDescriptionDefault
stepsNoOptional list of step/page names for this feature, e.g. ["email", "otp", "password"]. Defaults to [featureName].
overwriteNoWhether to overwrite existing files if they already exist. Default: false.
featureNameYesName of the domain feature in kebab-case or camelCase, e.g. "auth", "checkout", or "user-profile" (max 64 characters).
projectRootNoOptional path to target project root. Auto-detected if omitted.

Output Schema

NameRequiredDescriptionDefault
featureYes
skeletonYes
specFileYes
domainDirYes
nextStepsYes
factoryFileYes
createdFilesYes
skippedFilesYes
diagnosticsFixtureFileYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses exactly which files are generated and that the spec is a non-functional skeleton whose tests are test.fixme (skipped) and tagged @mcp-skeleton until TODOs are implemented. It stops short of stating that files are written to disk by default and how conflicts with existing files behave beyond the schema's overwrite flag.

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 verb and artifact list, then the skeleton caveat, then the usage rule; three sentences with almost no filler. The first sentence is a long comma-run list, which is dense but justified since it defines the tool's scope.

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?

An output schema exists, so return values need not be explained, and the description covers inputs' intent, generated artifacts, and the skipped-skeleton behavior. The remaining gap is prerequisites/ordering relative to sibling tools like check_test_prerequisites.

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 featureName, steps, overwrite, and projectRoot are already fully documented in the schema (including kebab-case/camelCase examples and the steps default). The description adds no parameter-level meaning beyond what the schema provides, which is the baseline 3.

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 (scaffold) and enumerates the exact artifacts produced: pages, mock API handlers, real API helpers, custom fixture, dynamic data factory, a spec, plus a shared diagnostics fixture under tests/e2e/support. No sibling tool creates project scaffolding, so the purpose is unmistakable against run_playwright_test, score_test_quality, or generate_test_report.

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?

"Always use this before writing new tests to ensure a consistent structure" gives explicit when-to-use guidance and a clear ordering constraint relative to test authoring. However, it names no alternatives and states no when-not-to-use condition (e.g., how it relates to check_test_prerequisites).

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