Skip to main content
Glama
ZenRows
by ZenRows

browser_evaluate

Execute JavaScript in a browser context and return the result, so you can extract dynamic data or interact with a rendered page after navigation.

Instructions

Execute JavaScript in the browser context and return the result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesJavaScript expression or function body to evaluate in the page context
session_idYesSession ID returned by browser_navigate

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.7.0

TDQS

C2.9/5.0
Behavior2/5

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

Annotations declare openWorldHint=true and, notably, readOnlyHint=false (destructiveHint=false), implying the evaluated script can mutate page state — yet the description says nothing about mutation risk, sandboxing, timeouts, or error behavior. It adds essentially no behavioral context beyond the annotation block.

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 front-loaded sentence with no wasted words, which is appropriate for a one-line tool summary. It is efficient, though the brevity comes at the cost of the missing context noted elsewhere.

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?

Arbitrary JS execution is a high-power operation with no output schema and no description of return-value serialization, error propagation, or whether the script runs in an isolated context. For this complexity level the one-liner leaves the agent guessing on key operational details.

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 both script and session_id are already documented in the schema. The description adds nothing about the script argument's expected form (expression vs function body) or session_id provenance, so the 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 ("Execute") and resource ("JavaScript in the browser context") plus the return behavior. Among the many browser_* siblings, this is the only script-execution tool, so an agent can distinguish it, though the description makes no explicit sibling comparison.

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?

There is no guidance on when to reach for this versus browser_get_text, browser_get_html, extract, or other siblings. It states what it does but never when-not-to-use it or what alternative fits a read-only DOM need.

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