Skip to main content
Glama
ImadMoka

playwright-mcp-supercharged

by ImadMoka

browser_run_code

Destructive

Execute Playwright JavaScript functions to automate browser interactions, such as clicking elements and retrieving page data, in isolated sessions.

Instructions

Run Playwright code snippet

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.
sessionIdNoTarget session ID. Omit to use the active session.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.8/5.0
Behavior2/5

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

Annotations already declare destructiveHint=true, openWorldHint=true and readOnlyHint=false, so the risk profile is covered structurally. The description adds nothing beyond that — it never warns that arbitrary code executes in the page context, nor explains what the snippet returns. With annotations carrying the safety load, this is a minimal-value description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single four-word fragment is admirably front-loaded and waste-free, but it is under-specified rather than genuinely concise — there is no room left for required context.

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 an arbitrary-code-execution tool with no output schema, the definition should say what the snippet's return value becomes and confirm page/session scoping. Neither is present, leaving the agent guessing about results and side effects.

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 the schema richly documents code, filename (including the precedence rule when both are given) and sessionId. Baseline 3 applies since the description itself adds no parameter meaning.

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?

States a specific verb and resource ("Run Playwright code snippet"), so an agent understands this executes arbitrary Playwright/JS against a page. It does not distinguish itself from siblings like browser_evaluate or the dedicated action tools, but the purpose is clear.

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?

No guidance on when to reach for this generic escape hatch versus the dedicated tools (browser_click, browser_type, browser_evaluate) or when to supply code vs filename. The agent must infer that this is a fallback for actions no sibling covers.

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