Skip to main content
Glama
ImadMoka

playwright-mcp-supercharged

by ImadMoka

browser_evaluate

Destructive

Run JavaScript expressions on a web page or specified element to extract data, test behavior, or produce computed output; save results to a file when needed.

Instructions

Evaluate JavaScript expression on page or element

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoExact target element reference from the page snapshot
elementNoHuman-readable element description used to obtain permission to interact with the element
filenameNoFilename to save the result to. If not provided, result is returned as text.
functionYes() => { /* code */ } or (element) => { /* code */ } when element is provided
sessionIdNoTarget session ID. Omit to use the active session.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

Annotations already declare destructiveHint=true, readOnlyHint=false and openWorldHint=true, so the safety profile is known. The description adds nothing beyond that: it does not warn that arbitrary code runs in page context, that DOM mutations persist, or that return values must be serializable (the filename fallback is only in the schema).

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?

One efficient, front-loaded sentence with no filler. It is appropriately sized, though arguably terse to the point of under-specification for a destructive execution tool.

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?

No output schema exists, so the description should explain what comes back (text result, or file when filename is given) and the serialization constraint. For a destructive, arbitrary-code tool with a required function parameter, this is a meaningful gap.

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%, so the function signature, element ref, filename and sessionId semantics are already documented. The phrase 'on page or element' lightly signals that element changes the function signature, but adds no detail beyond the schema. Baseline 3 applies.

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: evaluate a JavaScript expression against a page or element. That is clearer than a restatement of the name, but it offers no differentiation from the close sibling browser_run_code, which an agent must otherwise infer from schemas.

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?

The description gives no when-to-use guidance, no prerequisites, and no mention of alternatives such as browser_run_code or browser_console_messages. The agent must guess which execution tool is appropriate from name alone.

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