Skip to main content
Glama

write_test

Generates a Playwright-based pytest test from crawled page data following a user instruction, and provides the path to the test file for execution.

Instructions

Generate a pytest Playwright test based on crawl data and a user instruction. Always call crawl_page first to get the crawl_data. Returns the path to the generated test file — pass it as test_file when calling run_test.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
crawl_dataYesThe crawl data returned by crawl_page as a JSON string.
instructionYesWhat the test should do.
output_dirYesThe absolute path of the project the user is currently working in — this is where tests and reports will be saved. Use your working directory context to determine this. In Claude Code CLI this is the directory you were launched from. In VS Code it is the workspace root. Never use the MCP server's own directory. Never ask the user for it.
show_browserNoIf true the browser opens visibly during the test. Default is false.
Behavior3/5

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

No annotations provided. The description discloses the return value (file path) and prerequisite (crawl_data), but does not mention side effects, error conditions, or required permissions. Acceptable but could be more thorough.

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 with no wasted words. Front-loaded with the primary action ('Generate a pytest Playwright test'). Efficiently communicates workflow and return value.

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?

No output schema exists, but the description explains the return value. Parameter descriptions are comprehensive. Workflow with sibling tools is clearly explained. Could mention error handling or validation, but overall sufficient for an agent.

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

Parameters4/5

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

Schema covers 100% of parameters with descriptions. The tool description adds value by explaining that output_dir should be the current project directory and that crawl_data comes from crawl_page, complementing the schema.

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 clearly states the tool generates a pytest Playwright test from crawl data and an instruction, and distinguishes it from siblings by specifying a workflow order: crawl_page first, then this, then run_test.

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?

Explicitly advises to call crawl_page first and mentions how the output (test_file) is used in run_test. Lacks explicit when-not-to-use but the workflow context provides adequate guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/parajuliminiyan/PlaywrightMCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server