Skip to main content
Glama

browser_eval

Executes JavaScript in the current browser page and returns the JSON result; disabled unless AGENT_ALLOW_EVAL=1.

Instructions

Ejecuta JavaScript en la página y devuelve el resultado (JSON). Desactivada salvo AGENT_ALLOW_EVAL=1.

Input Schema

NameRequiredDescriptionDefault
expressionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.1/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 burden and does disclose one important operational trait: the tool is feature-gated behind AGENT_ALLOW_EVAL=1. It says nothing about execution context, whether page state can be mutated by the evaluated code, async/promise handling, error behavior, or return-value serialization limits.

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 sentences with no filler, and the core action is front-loaded ahead of the availability caveat. The definition is efficient, though its brevity comes at the cost of the missing detail noted elsewhere rather than being tight-but-complete.

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

Completeness2/5

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

For an arbitrary-code-execution tool with no annotations, no output schema, and an undocumented parameter, the description is too thin. An agent cannot tell what the JSON result looks like, what happens on a JS error or timeout, or what side effects on the page are permitted.

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?

There is one parameter (`expression`) with 0% schema description coverage, so the description must compensate and largely does not. 'Ejecuta JavaScript' weakly implies the string is JS source, but nothing says whether it is an expression vs statements, whether it may be async, or what serialization constraints the returned value must satisfy.

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 — runs JavaScript in the page and returns the result as JSON — which is unambiguous about what the tool does. It does not, however, differentiate itself from close siblings such as browser_console or browser_extract, so an agent must infer the boundary.

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 only guidance is an availability condition (disabled unless AGENT_ALLOW_EVAL=1), which is useful but is a gate rather than a when-to-use rule. It never says when arbitrary JS evaluation is preferable to browser_console, browser_extract, or browser_find, nor when it should be avoided.

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