Skip to main content
Glama

run_tests

Run e2e tests in the project’s own CLI process and return each test, failure code frames, and summary; narrow runs by files, tags, grep, targets, or changed files.

Instructions

Run tests as npx e2e run does and return what it printed: each test, the failures with their code frames, and the summary. Without files it runs every test the config discovers; files narrows to a test file, a directory, a glob, or one test (tests/checkout.e2e.ts:12). The run is the CLI's own, in its own process, with its workers, retries, replay cache, and report (.e2e/report.json by default); it needs no open session and leaves open sessions alone. One run at a time; cancelling the call interrupts it as Ctrl-C would. To fix a failing test, open_session {test: ":"} stops on the screen where it failed.

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
tagNoOnly tests carrying any of these tags
grepNoOnly tests whose title (describe titles and test title, space-joined) matches this regular expression
filesNoWhat e2e run takes as positionals: files, directories, quoted globs, or file:line for the test declared on that line (tests/checkout.e2e.ts:12). Default: every test the config discovers
configNoPath to an e2e config file, absolute or relative to the server's working directory; default: the server's --config, else the nearest e2e.config.ts
headedNoShow the browser or simulator while tests run, when the engine supports it; default: headless, unless the server was started with --headed
targetNoTarget names to run on; default: the server's --target, else every target
noCacheNoRun with the replay cache off, so every agent step calls the model
retriesNoRetries per failing test; default: from the config. 0 while fixing a test
workersNoParallel workers; default: from the config
excludeTagNoLeave out tests carrying any of these tags
grepInvertNoLeave out tests whose title matches this regular expression
lastFailedNoOnly the tests the previous run did not pass
repeatEachNoRun every selected test this many times, to measure a flaky one
maxFailuresNoStop the run once this many tests have failed
changedSinceNoRun the configured test filters on what differs from this git ref, such as origin/main
actionTimeoutNoMilliseconds each engine operation may take, such as a locator waiting for its element; 5000 while fixing a test
updateSnapshotsNoWrite the stored screenshots toHaveScreenshot finds missing or different, and pass

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.23.1

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, openWorldHint=false), it discloses that the run happens in the CLI's own process with its own workers, retries, replay cache, and report file at .e2e/report.json. It also explains that cancellation interrupts the run as Ctrl-C would and that concurrent runs are not allowed, which are exactly the behaviors an agent must know before invoking.

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?

The description is front-loaded with what the tool does and what it returns before moving to scoping, execution model, and the debugging hand-off. It is dense but nearly every clause carries operational information; a couple of the execution-model details could be trimmed without loss.

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

Completeness5/5

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

For a 17-parameter tool with no output schema, the description compensates by describing the return shape (per-test results, failures with code frames, summary) and the side effects (report file, interruption semantics, session isolation). Nothing an agent needs in order to call it correctly appears to be missing.

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 17 parameters are already documented in the schema, including files, retries, workers, and noCache. The description reinforces the files positional semantics and mentions workers/retries/cache exist, but adds no syntax or defaults beyond what the schema states, so the baseline of 3 applies.

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 names a specific verb+resource ("Run tests") and anchors it to a known behavior ("as npx e2e run does"), then states exactly what it returns: each test, failures with code frames, and the summary. It also distinguishes itself from the sibling by noting it needs no open session, so an agent can tell it apart from open_session without opening a schema.

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

Usage Guidelines5/5

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

It gives explicit routing: without files it runs everything the config discovers, while files narrows to a file, directory, glob, or file:line. It also names the alternative workflow by pointing to open_session {test: "<file>:<line>"} when the goal is fixing a failing test, and states the one-run-at-a-time constraint.

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

Deploy Server

Other Tools