Skip to main content
Glama

eval

Runs JavaScript expressions in a browser tab to inspect or change page state and return the result for automation tasks.

Instructions

Evaluate a JavaScript expression in the page.

Input Schema

NameRequiredDescriptionDefault
tabNotab id, defaults to current
expressionYes
request_timeoutNoOuter page request deadline in milliseconds; defaults to at least 30000

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.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 the full disclosure burden and says nothing about executing arbitrary code, which execution context (main world vs isolated world) it runs in, side effects on page state, or whether the expression's value is returned or serialized. For a code-evaluation tool this is a substantial omission.

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?

A single front-loaded sentence with no filler, though its brevity borders on under-specification rather than true economy.

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?

No output schema and no annotations mean the description must explain the return value and the behavior of evaluated code, which it does not. An agent cannot tell from this definition what comes back or what risks it takes by calling it.

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 67%; 'tab' and 'request_timeout' are already documented in the schema. The description only clarifies that the expression is JavaScript, adding little beyond the schema and leaving the required 'expression' parameter's semantics (syntax, awaited promises, return value) unstated.

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?

The description states a specific verb and resource ('Evaluate a JavaScript expression') in the page context, making the operation instantly recognizable. It does not differentiate from siblings, but no sibling overlaps with this capability, so the gap is minor.

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?

There is no guidance on when to use this versus the structured alternatives (text, html, attr, find, snapshot), which cover most read needs. No mention of when evaluation is inappropriate or risky is given.

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