Skip to main content
Glama

evaluate

Run a JavaScript expression or arrow function in the current page and return the result as JSON for in-page data extraction or checks; output is treated as untrusted page content.

Instructions

Run a JS expression or arrow function in the page; result returned as JSON (wrapped as untrusted page content). Disabled when CLOAK_ALLOW_EVAL=0.

Input Schema

NameRequiredDescriptionDefault
scriptYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations cover the safety profile (readOnlyHint=false, destructiveHint=false, openWorldHint=true), and the description adds real value beyond them: results are wrapped as untrusted page content, which is a critical prompt-injection warning the annotations do not convey, plus the environment-variable kill switch. It stops short of noting timeouts, async/promise handling, or which frame context the script runs in.

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?

Two short sentences, zero padding, with the operative capability and the return semantics front-loaded and the availability gate attached as a compact parenthetical-style clause.

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?

An output schema exists, so the description is not obligated to explain return values, and it already flags the untrusted-content wrapping and the disable condition. The remaining gap is execution semantics (async support, timeout, target frame), which matters for a script-running tool but is narrower than a fundamental omission.

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 0% and the single parameter is bare `script: string`, so the description must compensate. "JS expression or arrow function" does add meaningful shape information — it is not an arbitrary statement block — but the contract is still ambiguous: whether the arrow function is invoked for you, whether async/await works, and how the return value is serialized are all left to inference.

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?

A specific verb-plus-resource statement: run a JS expression or arrow function in the page and get the result back as JSON. It is clearly distinct from the sibling extraction tools (get_text, extract_structured, extract_tables) because it executes arbitrary code rather than a fixed extraction, though it never names those siblings explicitly.

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 supplies a real gating condition ("Disabled when CLOAK_ALLOW_EVAL=0") that saves the agent a failed call, but it gives no explicit when-to-use vs when-to-use-an-alternative guidance — nothing says to prefer extract_structured or get_text for routine scraping, or that this is the escape hatch for page-specific logic.

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