Skip to main content
Glama

evaluate

Execute JavaScript in the browser page context for computation, style mutations, shadow-root traversal, and in-page fetch. Avoid using for automatic recovery, scrolling, or element discovery.

Instructions

Execute JavaScript in the browser page context. Good uses: computation, style mutations (.style.X = ..., classList.add), shadow-root traversal, in-page fetch(), app-specific side effects no dedicated tool covers. Bad uses: (1) automatic recovery after a click/type/fill_form failure — call view_page for fresh refs and retry instead; (2) scrolling — use scroll via run_plan (returns position + content growth); (3) element discovery (querySelector/getElementById/innerText) — prefer view_page or fill_form. Scope is shared between calls — top-level const/let/class are auto-wrapped in IIFE. If/else blocks may return undefined — use ternary (a ? b : c) or explicit return.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYesJavaScript code to execute in the page context
await_promiseNoWhether to await Promise results
Behavior4/5

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

No annotations provided, so description carries full burden. It discloses scope sharing, IIFE wrapping for top-level declarations, and that if/else may return undefined—suggesting ternary or explicit return. This is valuable beyond the input schema, though it could mention sandboxing or security implications.

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?

Description is well-structured with bullet points and clear sections, front-loaded with the main purpose. Every sentence adds value, though it is slightly verbose. Could be more concise without losing clarity.

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?

Despite thorough coverage of usage and behavior, the description omits information about the return value of the executed JavaScript. Since there is no output schema, this is a significant gap for an agent to understand what the tool returns, especially for promise handling.

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 coverage is 100% (expression and await_promise are fully described in the schema). Description adds minimal additional meaning beyond the schema, primarily discussing execution behavior rather than parameter details. Baseline 3 is appropriate.

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?

Description clearly states 'Execute JavaScript in the browser page context' with a specific verb and resource. It distinguishes good uses (computation, style mutations, shadow-root traversal) from bad uses with explicit alternatives (view_page, scroll, fill_form), differentiating it from 24 sibling tools.

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?

Explicitly lists good uses, bad uses, and alternatives for each bad case (e.g., automatic recovery after failure → view_page; scrolling → scroll via run_plan; element discovery → view_page or fill_form). Provides clear when-to-use and when-not-to-use guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Silbercue/public-browser'

If you have feedback or need assistance with the MCP directory API, please join our Discord server