Skip to main content
Glama

zerodom_eval_js

Execute arbitrary JavaScript in the active browser tab's live context and return the result, enabling direct DOM interaction and console-level debugging.

Instructions

Run arbitrary JavaScript in the active tab's real page context and return the result — Runtime.evaluate over the same chrome.debugger connection everything else here uses, the same power as typing into DevTools' own console.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.0.8

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden, and it is transparent about arbitrary code execution in the live page via Runtime.evaluate. This signals potential mutation and risk. It could add caveats about side effects or result serialization, but the 'same power as DevTools console' comparison makes the behavioral profile clear.

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 one dense, well-ordered sentence: action and target first, then the protocol-level clarification. Every clause earns its place, and there is no padding or repetition of schema fields.

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?

For a one-parameter eval tool with an output schema, the description covers what code runs, where it runs, and how it is executed, which is the core context an agent needs. It could explicitly mention async/promise handling or serialization limits, but the output schema and the DevTools-console analogy cover most of the remaining ambiguity.

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 description coverage is 0%, so the description must compensate, and it does: it clarifies that the sole 'code' parameter is arbitrary JavaScript executed in page context, adding real meaning beyond the bare field title. It does not document expression-vs-statement semantics or serialization, but the single parameter's meaning is essentially fully established.

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 names the specific verb ('Run'), the target resource ('active tab's real page context'), and the outcome ('return the result'). It clearly distinguishes this from sibling action/read tools by framing it as arbitrary JavaScript evaluation with the same power as the DevTools console.

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

Usage Guidelines3/5

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

The description conveys that this is the general-purpose 'do anything via JS' tool and implies it is the fallback for behavior not covered by specialized tools. However, it does not explicitly state when to prefer it over siblings like zerodom_click_node or zerodom_read_page, nor does it mention exclusions.

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