Skip to main content
Glama

Export the session as a Playwright test

browser_export_test

Convert recorded browser session actions into a runnable @playwright/test spec using role+name locators that survive re-renders, and optionally write it to disk.

Instructions

Convert every action performed in this session into a runnable @playwright/test spec file, using role+name locators so the test survives re-renders. Returns the file contents, and optionally writes them to disk.

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

Input Schema

NameRequiredDescriptionDefault
pathNoAbsolute path to write the spec to. When omitted the spec is only returned.
titleNoTest title. Default: "Recorded browsing session".

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses the locator strategy (role+name, chosen to survive re-renders), that file contents are returned, and that disk writes are optional. It does not say whether a recorded session must exist, what happens with an empty session, whether an existing file at path is overwritten, or whether exporting alters/resets session state.

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, no filler, and the core purpose is front-loaded. The locator-rationale clause and the return/write clause each carry distinct information.

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 two-optional-parameter export tool with no output schema, the description covers the key ground: what is produced, how locators are generated, and that the spec is returned with optional disk persistence. Remaining gaps (session prerequisites, overwrite behavior) are modest but real for a tool with zero annotation coverage.

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 both path and title are already documented, including the title default. The description's phrase 'optionally writes them to disk' reinforces the path semantics but adds no syntax or format detail beyond the schema. Baseline 3 is appropriate.

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?

The description gives a specific verb and output artifact: convert recorded session actions into a runnable @playwright/test spec file. It also names the locator strategy (role+name). It does not explicitly distinguish itself from siblings like browser_snapshot or browser_batch, but the export-to-test-file purpose is self-evidently distinct.

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

Usage Guidelines3/5

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

Usage is only implied: 'every action performed in this session' signals that the tool is meant to run after a recording session, and 'optionally writes them to disk' hints at path usage. There is no explicit when-to-use vs when-not guidance, no prerequisite stating a session must be active, and no alternatives named.

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