Skip to main content
Glama

evaluate_script

Run a read-only JavaScript function in an isolated context hidden from the page and return its value as JSON; side effects are blocked and execution stops after one second.

Instructions

Run a JavaScript function that only reads, in a world the page cannot see, and get its value back as JSON. Any write, request or call with an effect is stopped before it lands, and a run ends after 1 s. Only with the Secret Layer off.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "evaluate_script"
  }
}

Input Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.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, and it does well: writes, requests and effectful calls are blocked before execution, runs are capped at 1 s, and results return as JSON. However, it omits what happens on timeout or blocked writes (error shape), whether async functions are supported, and any result-size limits — meaningful gaps for a sandboxed execution tool.

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?

Three short sentences with no filler, and the read-only guarantee is front-loaded ahead of the timeout and the Secret Layer caveat. The phrase 'in a world the page cannot see' is evocative but slightly less precise than 'isolated world' would be.

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?

For a zero-parameter sandboxed-eval tool with no output schema and no annotations, the description covers safety and timeout well but leaves the input mechanism and error behavior unspecified. An agent still knows the guardrails, but not how to actually supply code or interpret failures.

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?

The input schema is an empty object with zero parameters, which nominally sets a baseline of 4, but the description says the tool 'runs a JavaScript function' while never explaining how that function is supplied — an unresolved ambiguity the schema does not clear up either. That missing detail pulls the score down.

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 — 'Run a JavaScript function' — and immediately scopes it to read-only evaluation in an isolated world ('a world the page cannot see'). An agent knows precisely what the tool does, though no sibling is named to sharpen differentiation from tools like dom_html or computed_style.

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?

It gives one explicit precondition, 'Only with the Secret Layer off,' which tells the agent when the tool is unavailable. It does not say when this is preferable to reading the page through dom_html or computed_style, nor any explicit when-not beyond the Secret Layer constraint.

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