Skip to main content
Glama

playwright_evaluate

Run JavaScript code directly in the browser console with Playwright MCP Server's browser automation tool. Simplify web testing, content scraping, and dynamic interaction in real browser environments.

Instructions

Execute JavaScript in the browser console

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesJavaScript code to execute

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action but fails to mention critical traits such as execution context (e.g., page scope), error handling, security implications, or whether it returns a value. This is inadequate for a tool that executes arbitrary JavaScript.

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 a single, clear sentence with zero wasted words. It is front-loaded and efficiently conveys the core purpose without unnecessary elaboration, 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.

Completeness2/5

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

Given the complexity of executing JavaScript in a browser (with no annotations or output schema), the description is insufficient. It lacks details on return values, error behavior, or execution scope, which are crucial for safe and effective use. This leaves significant gaps in understanding the tool's full context.

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 schema description coverage is 100%, with the 'script' parameter fully documented in the schema. The description adds no additional meaning beyond what the schema provides, such as examples or constraints on the JavaScript code. 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 ('Execute JavaScript') and the context ('in the browser console'), which is specific and unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'playwright_console_logs' (which retrieves logs) or other JavaScript execution contexts, keeping it from a perfect score.

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. For example, it doesn't mention when to prefer this over other Playwright tools for interaction or how it relates to siblings like 'playwright_get_visible_html'. This lack of context leaves the agent without usage direction.

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