Skip to main content
Glama

evaluate_js

Run custom JavaScript in the active browser page and return the JSON result, allowing precise DOM reads or edits when built-in tools fall short. Requires IB_ALLOW_EVAL_JS=true.

Instructions

Run JavaScript in the page and return JSON result. Disabled unless IB_ALLOW_EVAL_JS=true.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses the required environment flag, but does not explain that executing arbitrary JavaScript can mutate page state, what security implications exist, or whether the operation is read-only. The disclosure is partial but valuable.

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 two short sentences with no wasted words and front-loads the core action before the enablement caveat. It is appropriately sized for a one-parameter tool.

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?

An output schema exists, so return values need not be explained. However, important context is missing: the description does not help an agent choose this tool over sibling browser tools, and it leaves the expression parameter entirely undocumented despite the schema providing no description.

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

Parameters2/5

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

Schema coverage is 0% and the description does not describe the 'expression' parameter's expected format or syntax. The phrase 'return JSON result' hints that the expression should evaluate to a JSON-serializable value, but this is only implicit and does not compensate for the missing parameter documentation.

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 states a specific verb ('Run') and resource ('JavaScript in the page') with the output form ('return JSON result'). No sibling tool executes JavaScript, so the purpose is unambiguous even without naming an alternative.

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 description only gives an enablement precondition ('Disabled unless IB_ALLOW_EVAL_JS=true') and never says when to use this tool versus alternatives like click, fill, or get_page_text. It provides no context or exclusions for selecting it.

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