Skip to main content
Glama

browser_evaluate

Read-onlyIdempotent

Run JavaScript in the page context and return the result. Use for state not in the a11y tree, captcha iframe inspection, DOM events. Expression is either a plain JS value ('document.title') or a zero-arg IIFE ('(() => { … })()'). Inline any runtime values into the expression itself. Result is JSON-serialized; non-serializable values become strings. 256KB cap on output.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
page_idYes
expressionYes
in_workspaceNoRun this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / in_workspace
      Added value: +{
      +  "description": "Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected.",
      +  "type": "integer"
      +}
  2. Added
  3. Removed
  4. Added
  5. Removed
  6. Added
  7. Removed
  8. Added
  9. Removed
  10. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Beyond the annotations (which only assert read-only/idempotent safety), the description discloses real behavioral traits: the result is JSON-serialized, non-serializable values are coerced to strings, and output is capped at 256KB. That is meaningful invocation-relevant context. It does not address async/promise handling or execution-time failures, which keeps it from a 5.

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?

Every sentence earns its place: purpose first, then use cases, then expression format, then result serialization and the size cap. No repetition of schema or annotation content and no filler.

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?

With no output schema, the description carries return-value semantics itself, covering serialization and truncation limits. Combined with the expression-format rules this is nearly complete; only execution semantics (awaited promises, timeouts, errors) are unaddressed.

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 low (33%), so the description must carry the load, and it does for the critical 'expression' parameter: it defines accepted shapes (plain JS value vs. zero-arg IIFE), gives literal examples, and warns to inline runtime values. 'page_id' is left undocumented, so the compensation is strong but incomplete.

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?

States a specific verb and resource ('Run JavaScript in the page context and return the result') and immediately scopes it with use cases (state not in the a11y tree, captcha iframe inspection, DOM events) that separate it from browser_snapshot and the click/type family. An agent can distinguish it from siblings without opening any schema.

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

Usage Guidelines4/5

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

Gives clear positive routing ('Use for state not in the a11y tree...'), which implicitly excludes cases the accessibility snapshot already covers. No explicit 'do not use when' clause or named alternative tool is given, so it stops just short of a full when/when-not rule set.

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.