Skip to main content
Glama

browser_evaluate

Destructive

Execute JavaScript in the browser context and return the result. The script can change or delete the session's page state, such as cookies, storage and form data.

Input 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. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, destructiveHint=true and openWorldHint=true, so the bar is lower. The description still earns credit by concretizing the blast radius: cookies, storage and form data can be changed or deleted, which is more actionable than a bare 'destructive' flag. It does not discuss sandboxing, timeouts, or what the return value looks like.

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?

Two tight sentences: the capability first, the risk second. No filler, no restating the tool name, and the most important caveat is not buried.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

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

No output schema, and the description does say a result is returned, but not in what form (serialized? JSON-safe? errors thrown?). Annotations plus the destructive-state warning cover the safety picture well, so the remaining gap is small.

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% with only two parameters, both documented in the schema (script semantics and session_id provenance). The description adds nothing about script syntax, serialization of results, or how errors surface, 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 and resource: 'Execute JavaScript in the browser context and return the result.' An agent can immediately tell this is the arbitrary-script escape hatch versus the many narrow siblings (browser_click, browser_get_text, etc.). It stops short of naming any sibling it supersedes, so 4 rather than 5.

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 when-to-use guidance at all. Given the large set of purpose-built siblings, the description never says to prefer browser_get_text/browser_click and only fall back to browser_evaluate for cases they don't cover. The side-effect warning hints at caution but does not route the agent to an alternative.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.