Skip to main content
Glama
Angeluis001

Playwright MCP

by Angeluis001

browser_evaluate

Destructive

Execute JavaScript code on web pages or specific elements to extract data, manipulate content, or automate interactions through browser automation.

Instructions

Evaluate JavaScript expression on page or element

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
functionYes() => { /* code */ } or (element) => { /* code */ } when element is provided
elementNoHuman-readable element description used to obtain permission to interact with the element
refNoExact target element reference from the page snapshot

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.5/5.0
Behavior4/5

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

The description doesn't contradict annotations. Annotations indicate this is a destructive, non-read-only operation with open-world characteristics. The description adds context by specifying it evaluates JavaScript on 'page or element,' which helps clarify the scope beyond what annotations provide. However, it doesn't detail potential side effects like page modifications or security implications.

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 extremely concise—a single, clear phrase with no wasted words. It's front-loaded with the core functionality, making it easy to understand at a glance without unnecessary elaboration.

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 (JavaScript evaluation in a browser with destructive potential) and lack of output schema, the description is minimal. It covers the basic purpose but doesn't address return values, error handling, or security considerations, leaving gaps for an AI agent to infer behavior in a potentially risky operation.

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?

With 100% schema description coverage, the schema already documents all three parameters thoroughly. The description adds minimal value beyond the schema by implying the 'element' parameter is optional (evaluating on 'page or element'), but doesn't provide additional syntax or usage details. This meets the baseline for high schema coverage.

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 clearly states the action ('evaluate') and target ('JavaScript expression on page or element'), distinguishing it from sibling tools that perform physical interactions like click, type, or navigate. However, it doesn't specify that this is for browser automation contexts, which is implied but could be more explicit.

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 provides no guidance on when to use this tool versus alternatives. It doesn't mention that this is for executing custom JavaScript code in a browser context, nor does it differentiate from other browser tools like browser_console_messages (for reading console output) or browser_snapshot (for capturing page state).

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