Skip to main content
Glama

Run Playwright tests

run_tests

Execute Playwright tests in the project and return per-test results, including failure errors, locations, and the failing locator to pass to locator healing.

Instructions

Run Playwright Test in the project and return per-test results. Failures include the error, its location and, when the cause was a locator, the locator Playwright was waiting for (pass it to heal_locator).

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": "run_tests"
  }
}

Input Schema

NameRequiredDescriptionDefault
grepNoOnly run tests whose title matches
specNoSpec file relative to tests/; omit to run everything
projectNoOnly this Playwright project from playwright.config, e.g. "Mobile Safari"; omit to run all projects

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.0
    • addedInput schema / properties / project
      Added value: +{
      +  "description": "Only this Playwright project from playwright.config, e.g. \"Mobile Safari\"; omit to run all projects",
      +  "type": "string"
      +}
  2. First observedv0.2.1

TDQS

A4.5/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does solid work: it discloses the result granularity (per-test) and the failure payload (error, location, and the awaited locator). It doesn't mention runtime cost, timeouts, parallelism, or whether the run mutates project state, which are notable gaps for a tool that launches browsers.

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?

Two sentences, zero filler, front-loaded with the core action and result shape, then the failure detail and the handoff. Every clause earns its place.

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 zero-required-parameter runner with a fully described schema and no output schema, the description covers return contents adequately, so an agent knows what a failure looks like. Missing operational context (duration, timeout behavior under no annotations) keeps it from a 5.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all three parameters (grep, spec, project) are already documented, and the baseline would be 3. The description adds no redundant param text, avoiding noise. It justifies a 5 for not duplicating schema content.

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 ('Run Playwright Test in the project') plus the return shape ('per-test results'), which clearly separates it from siblings like write_test and heal_locator. An agent can identify what this does without opening the schema.

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?

Usage is clear from the framing (execute the suite to get results) and it gives explicit follow-up routing: when a failure's cause was a locator, pass it to heal_locator. It stops short of saying when to prefer grep vs spec vs project selection or when not to run the full suite, so no true exclusions are offered.

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