Skip to main content
Glama

browser_evaluate

Evaluate JavaScript in the current browser page and return the result, enabling MCP clients to inspect or manipulate page state during Playwright automation.

Instructions

Evaluate JavaScript in the page and return the result.

Input Schema

NameRequiredDescriptionDefault
jsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

C2.7/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It does not disclose that arbitrary JavaScript can mutate page state, whether promises are awaited, whether the return value must be JSON-serializable, or what happens on syntax errors/exceptions — all critical for a code-execution tool.

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?

A single tight sentence with no filler and the core action front-loaded. It's efficient, though the terseness leaves no room for the missing behavioral detail.

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 a high-power arbitrary code execution tool with no annotations, no output schema, and an undocumented parameter, the description is far too thin. An agent cannot confidently predict side effects or the shape of the returned result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

One parameter with 0% schema description coverage. The name 'js' hints at content, but the description says nothing about expected form (expression vs. function body), whether it is wrapped in an async context, or how the value is captured — details the schema leaves entirely blank.

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 (evaluate) and resource (JavaScript in the page) plus the return behavior. It is clear enough to distinguish from browser_read or browser_snapshot, though it never names those siblings explicitly.

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 use this instead of browser_read, browser_snapshot, or browser_click. An agent gets no signal about what this tool is appropriate for (extracting computed values? triggering page state?) versus other browser tools.

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