Skip to main content
Glama
v76ADrR
by v76ADrR

browser_evaluate

Run JavaScript in the current browser tab and return the result as a JSON string, enabling DOM inspection for iCloud and page automation.

Instructions

Run JavaScript in the current tab (page.evaluate). Return value is JSON-stringified. Use for iCloud DOM inspection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYesJS expression or IIFE, e.g. document.title or (() => {...})()

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries full behavioral burden. It usefully notes the return value is JSON-stringified, but says nothing about the fact that arbitrary JS can mutate page state, read sensitive data, or fail/throw — significant for an execution tool. Mutation and safety characteristics are undisclosed.

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?

Two short, front-loaded sentences with no filler; the core action leads. Slightly terse given the tool's risk profile, but nothing is wasted.

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

Completeness3/5

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

No output schema exists, and the description does cover the return format (JSON-stringified), which is the right thing to add. However, for a tool executing arbitrary JavaScript with no annotations, the absence of any safety or side-effect context leaves the agent under-informed.

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% and the schema itself already gives examples ('document.title or (() => {...})()'), so the parameter is fully documented structurally. The description adds no extra meaning about the expression parameter, 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 ('Run JavaScript in the current tab') and even names the underlying API (page.evaluate), so the agent knows exactly what happens. It doesn't explicitly differentiate from siblings like browser_snapshot or browser_find, but no sibling does JS evaluation, so confusion risk is low.

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?

The only guidance is 'Use for iCloud DOM inspection,' which is a narrow, context-specific hint rather than a when-to-use rule. It gives no conditions for preferring this over browser_snapshot, browser_find, or browser_click, and no when-not-to-use exclusions.

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