Skip to main content
Glama
Angeluis001

Playwright MCP

by Angeluis001

browser_run_code

Destructive

Execute Playwright JavaScript code to automate browser interactions like clicking buttons, filling forms, and extracting page data for web testing and automation tasks.

Instructions

Run Playwright code snippet

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesA JavaScript function containing Playwright code to execute. It will be invoked with a single argument, page, which you can use for any page interaction. For example: `async (page) => { await page.getByRole('button', { name: 'Submit' }).click(); return await page.title(); }`
Behavior4/5

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

Annotations indicate destructiveHint=true and openWorldHint=true, which the description doesn't contradict. The description adds valuable context beyond annotations by specifying that the code will be executed with a page argument for interactions, which helps the agent understand the execution environment. However, it doesn't mention potential side effects like page navigation or resource consumption that destructiveHint=true implies.

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?

The description 'Run Playwright code snippet' is extremely concise at just four words, front-loading the core purpose without any wasted words. Every element earns its place by clearly communicating the tool's function in minimal space, making it easy for an agent to parse quickly.

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

Completeness3/5

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

Given the tool's complexity (executing arbitrary code with destructive potential) and the absence of an output schema, the description is somewhat incomplete. It doesn't explain what the tool returns (e.g., the result of the executed function) or error handling. However, annotations provide safety context, and the schema covers the parameter well, making it minimally adequate but with clear gaps for a code execution tool.

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%, with the parameter 'code' fully documented in the schema as a JavaScript function containing Playwright code. The description doesn't add any additional parameter semantics beyond what's already in the schema. With high schema coverage, the baseline score of 3 is appropriate since the description doesn't compensate but also doesn't need to.

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 'Run Playwright code snippet' clearly states the action (run) and resource (Playwright code snippet), making the purpose immediately understandable. It distinguishes from siblings by focusing on executing arbitrary code rather than specific browser actions like click or navigate. However, it doesn't explicitly mention browser automation context, which could make the distinction slightly less sharp.

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?

The description implies usage for executing custom Playwright scripts, suggesting it should be used when specific browser actions aren't available as dedicated tools. However, it doesn't provide explicit guidance on when to use this vs alternatives like browser_click or browser_type, nor does it mention prerequisites like needing an active browser session. The context is clear but lacks explicit alternatives or exclusions.

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/Angeluis001/playwright-mcp'

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