Skip to main content
Glama

browser_evaluate

Read-only

Read computed styles, framework state, or list lengths by running JavaScript in the page and returning JSON. Use it for values other read tools cannot see.

Instructions

READ from the page with JavaScript and get the result as JSON.

Last, for what other tools cannot see: a computed style, a value held in a framework's state, the length of a list. Text, a heading or a price is browser_read_text's, markup browser_read_html's, a control browser_snapshot's: a script runs in the page, and they do not.

Acting on the page is refused, and the refusal names the tool to use. Assigning to value, checked or selected, or calling click(), dispatchEvent(), submit() or requestSubmit(), changes the page without a real keystroke or pointer, and a page can tell. Use browser_click, browser_type or browser_select_option instead. Reading any of those properties is fine.

The refusal catches the obvious spellings, not every possible one. A script that slips past it is still the wrong way to do the thing: report it in your answer rather than using it. Inside an iframe, pass the snapshot's frame.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "expression": "<expression>"
    },
    "name": "browser_evaluate"
  }
}

Input Schema

NameRequiredDescriptionDefault
frameNo
browserNoDefaults to `main`; `support` is the helper beside it.
expressionYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.74.0

TDQS

A4.5/5.0
Behavior4/5

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

readOnlyHint=true and destructiveHint=false already declare the safety profile, but the description goes well beyond them. It discloses a refusal mechanism and lists the specific sinks that trigger it (value, checked, selected, click, dispatchEvent, submit, requestSubmit). It also honestly admits the guard is incomplete ("catches the obvious spellings, not every possible one"), which an agent needs to know to avoid relying on it. No return-format detail is given, but an output schema exists.

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?

The description is front-loaded with the core purpose and the sibling boundaries, and each paragraph handles one concern: purpose, what to use instead, the refusal, and the caveat about its limits. Every sentence stands on its own, though the hard-wrapped lines read as fragments and the refusal catalogue is a little repetitive.

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?

For a complex arbitrary-code-execution tool with an output schema and full annotations, the description covers the important ground: scope, alternatives, the mutation guard and its limits, and iframe handling. The one real gap is expression semantics, which is essential for the required parameter and cannot be inferred from the bare `string` type.

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

Parameters4/5

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

Schema coverage is only 33%: just one of the three parameters, `browser`, has a schema description. The description compensates by explaining that `frame` should be filled with the snapshot's frame when working inside an iframe, and by characterizing `expression` as a read-only script whose result comes back as JSON. It still does not say how the expression is evaluated (sync or async, serialization limits), so it explains the parameters' meaning but not fully their syntax.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ("READ from the page with JavaScript") and immediately pins the scope to what no other tool can see (computed style, framework state, list length). It draws explicit boundaries against named siblings (browser_read_text, browser_read_html, browser_snapshot), so an agent can identify this tool without its schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives both sides of the routing decision. It says when to use it: only for values the other reading tools cannot reach. It also says when not to use it: anything that acts on the page belongs to browser_click, browser_type or browser_select_option. It also names the tool to use for text, markup and controls. Nothing is left to inference.

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