Skip to main content
Glama
Playwright MCP Server

Playwright MCP Server

by sohitmahato

playwright_generate_test

Convert recorded browser actions into a runnable test script for Playwright, Puppeteer, or Selenium in TypeScript, JavaScript, or Python. Specify the output file name to save the generated script.

Instructions

Generate a test script from recorded actions

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "framework": "<framework>",
      "language": "<language>",
      "fileName": "<fileName>"
    },
    "name": "playwright_generate_test"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNameYesOutput file name
languageYesProgramming language
frameworkYesTest framework

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden, yet it discloses nothing beyond the one-line action. It does not say whether an existing file with the same name is overwritten, whether generated files are written to the working directory, or what happens when the recorded action list is empty.

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 well-formed sentence with zero filler and the resource front-loaded. It is efficient, though brevity here shades into under-specification rather than economy.

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

Completeness2/5

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

For a tool with three required parameters, no annotations, and no output schema, the definition should at least say what is produced (a file path? a confirmation?) and what precondition must hold. Neither is covered, leaving an agent to guess about the recording prerequisite and the side effect of writing a file.

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% and both enums are documented in the schema, so the baseline is 3. The description adds no meaning beyond the schema – it never explains how fileName interacts with the working directory or whether framework and language can be mixed freely.

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 states a specific verb and resource ('Generate a test script') plus its input source ('from recorded actions'), which is enough to distinguish it from siblings like playwright_generate_workflow_test or the raw action tools such as playwright_click. It stops short of explicitly naming the sibling it differs from, so it lands at 4 rather than 5.

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?

'From recorded actions' only implies a prerequisite (something must have been recorded via playwright_record_start/stop); there is no explicit when-to-use statement, no exclusion of alternatives like playwright_generate_workflow_test, and no note about what to do if no recording exists.

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