Skip to main content
Glama
Kurtzi9
by Kurtzi9

browser_run_code_unsafe

Destructive

Run a custom Playwright JavaScript snippet with access to the page object to perform any browser interaction. Warning: executes arbitrary code in the server process, equivalent to remote code execution.

Instructions

Run a Playwright code snippet. Unsafe: executes arbitrary JavaScript in the Playwright server process and is RCE-equivalent.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeNoA 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(); }`
filenameNoLoad code from the specified file. If both code and filename are provided, code will be ignored.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.0.77

TDQS

A4/5.0
Behavior5/5

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

Annotations already flag destructive and read-write behavior, but the description adds the critical, non-obvious detail that execution happens in the Playwright server process and is RCE-equivalent. This is essential risk context beyond what the annotations convey.

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 is two tight sentences with no filler. The safety warning is front-loaded immediately after the action, and every phrase adds meaningful signal.

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?

The schema plus the unsafe warning cover most invocation details: how code is called, how filename works, and what risk is involved. The main gaps are not explicitly stating that code or filename is practically required and not describing the return behavior, but the schema example makes the return pattern inferable.

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?

The input schema already provides 100% parameter coverage, including the code invocation signature, the page argument, and filename precedence. The description itself adds no significant parameter-level meaning, so it stays at the schema-driven baseline.

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 lead sentence identifies a specific action and resource: 'Run a Playwright code snippet.' The unsafe clause further clarifies the execution context as arbitrary JavaScript in the Playwright server process, which is RCE-equivalent. It is clear, though it does not explicitly differentiate itself from the similarly code-oriented sibling browser_evaluate.

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 that this tool is for arbitrary Playwright code that specialized browser tools may not cover, especially with the strong 'Unsafe' and 'RCE-equivalent' warning. However, it never explicitly names a safer alternative or states when-not-to-use, leaving some inference to the agent.

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

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/Kurtzi9/playwright-mcp-render-mto6ljjz'

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