Skip to main content
Glama

browser_evaluate

Run arbitrary JavaScript in the page context to inspect runtime state, extract data, or trigger DOM actions during browser automation.

Instructions

Evaluate arbitrary JavaScript expression in the page context.

Input Schema

NameRequiredDescriptionDefault
tab_indexNo
expressionYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.8/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 of behavioral disclosure. It only states that arbitrary JavaScript is evaluated, omitting side effects, mutation potential, security considerations, and whether the page context can be altered.

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, front-loaded sentence with no wasted words. It is appropriately sized for the minimal amount of information it conveys.

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 powerful arbitrary code execution tool with no annotations, two parameters (one entirely undocumented), and ambiguous sibling overlap, the description is incomplete. The output schema exists, but it does not compensate for missing usage, security, or parameter context.

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?

Schema description coverage is 0%, so the description must compensate for both parameters. It implies the required 'expression' parameter but does not explain its format, and it says nothing about the optional 'tab_index' parameter.

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 states a specific verb ('Evaluate') and resource ('arbitrary JavaScript expression in the page context'), making the tool's basic purpose clear. However, it does not differentiate from sibling tools such as browser_run_code, which may also execute code in the browser.

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 use this tool versus alternatives, no exclusions, and no mention of conditions or prerequisites. With siblings like browser_run_code and browser_batch, the agent is left to infer the appropriate context.

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