Skip to main content
Glama

Generate an E2E test

generate-e2e-test
Destructive

Scaffolds a ready-to-run Playwright spec from a plain-language test description using real project selectors and recent file changes.

Instructions

Scaffold a Playwright test from a description using the project's REAL selectors. Scans the agent's recent file changes (git working tree / last commit, mtime fallback), extracts data-testid / role / label / placeholder / id locators with their source locations, optionally cross-checks them against the live page, writes a ready-to-run spec, and returns next steps.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoExact spec path (*.spec.ts / *.test.ts) inside the project instead of the default location
writeNoWrite the file to disk (default true)
configNoplaywright.config path or 1-based index
pageUrlNoPage the test starts on (default: baseURL from playwright.config)
testDirNoDirectory for the generated spec (default: detected testDir or tests/)
overwriteNoReplace an existing spec at the target path (only specs this tool generated)
descriptionYesWhat the test should cover, e.g. "login with valid credentials"
liveInspectNoVerify discovered selectors against the live page (default true when a URL is known)
projectRootNoProject directory; defaults to the server working directory

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.2

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, openWorldHint=true, and non-idempotent, so the safety profile is covered. The description earns credit for disclosing behavior beyond that: it scans the git working tree/last commit (mtime fallback), extracts specific locator types with source locations, optionally cross-checks the live page, writes the spec, and returns next steps. It only stops short of flagging the overwrite hazard explicitly.

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?

A single front-loaded sentence that leads with the verb and resource, then enumerates the pipeline steps compactly. Dense but every clause carries information with no filler, so it is easy to scan.

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 destructive, open-world generation tool with nine params and no output schema, the description covers the process and notes the return ('returns next steps'). It omits where the spec lands by default and any warning about writing to disk, but is otherwise complete enough to invoke correctly.

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 the schema documents all nine parameters and the baseline is 3. The description adds contextual meaning for a few (live cross-check implies liveInspect, project scanning implies projectRoot), but does not explain file, write, overwrite, or config beyond what the schema already states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (Scaffold) and resource (Playwright test spec) and adds the key qualifier 'using the project's REAL selectors', so the intent is unambiguous. It does not name or contrast with any sibling (e.g. validate-selector, inspect-page, run-test), so it stops short of explicit differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains the mechanism but never says when to reach for this tool versus siblings like validate-selector, inspect-page, or run-test. No when-to-use, when-not-to-use, or ordering guidance is provided, leaving routing to inference.

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