Skip to main content
Glama

browser_evaluate

Read-only

Evaluate JavaScript in a live page and return JSON, exposing computed styles, state, and list lengths invisible to other tools. Reads without changing the page, and redirects attempts to act to proper tools.

Instructions

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

For what the other tools cannot see: a computed style, a value held in a framework's state, the length of a list.

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; they do the same thing through the pointer and the keyboard. 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.

Input Schema

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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.68.0
    • addedInput schema / properties / browser / description
      Added value: +"Defaults to `main`; `support` is the helper beside it."
  2. First observedv0.43.0

TDQS

A4.7/5.0
Behavior5/5

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

The description goes beyond the readOnlyHint annotation by detailing exactly which operations are refused (assignments to value/checked/selected, and click/dispatchEvent/submit/requestSubmit calls). It also warns that the refusal is not exhaustive and instructs the agent to report a bypass instead of using it, which is valuable behavioral nuance.

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 front-loaded with the core purpose ('READ...'), then gives concrete use cases, then establishes boundaries and alternatives. Every sentence adds information an agent needs to use the tool correctly, and the longer length is justified by the nuanced read-only enforcement behavior.

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

Completeness5/5

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

Given that an output schema exists and the annotations already mark the tool as read-only, the description covers the remaining essential context: use cases, refusal behavior, alternative tools, and how to handle scripts that bypass the refusal. Nothing critical for correct invocation is missing.

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?

The schema only documents the 'browser' parameter, leaving 'expression' with just a type of string. The description clarifies that the expression is JavaScript code executed to read from the page and that the result comes back as JSON, but it does not specify syntax details such as whether it must be an expression, how to reference page context, or how complex scripts are supported. This partially compensates for the low schema coverage but leaves gaps.

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 'READ from the page with JavaScript and get the result as JSON,' which uses a specific verb, a clear resource, and the expected output format. It also distinguishes itself from siblings by saying it sees 'what the other tools cannot see' and by pointing to alternative tools for acting on the page.

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?

It explicitly states when to use this tool: to read computed styles, framework state, list lengths, or anything else other tools cannot see. It also explicitly says acting on the page is refused and directs the agent to browser_click, browser_type, or browser_select_option for those cases, making the when-not usage unmistakable.

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