Skip to main content
Glama

evaluate_js

Run JavaScript in a browser tab to inspect or manipulate page state; executes in an isolated world by default and can target page globals when needed.

Instructions

Evaluate JS in isolated world by default (alias: script=). Set main_world=True for page globals.

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_js"
  }
}

Input Schema

NameRequiredDescriptionDefault
tabNo
scriptNo
expressionNo
main_worldNo
max_lengthNo
timeout_msNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

B3/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. It usefully discloses that execution defaults to an isolated world and that main_world=True exposes page globals, which is meaningful behavioral context. It does not disclose side effects, security implications, timeout behavior, or what happens on failure.

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 two tight sentences with the execution-context default front-loaded. Every clause carries information, and there is no wasted wording.

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?

This is a six-parameter code-evaluation tool with no annotations and no schema descriptions. The description explains only the isolated-world default and main_world setting, omitting tab targeting, expression versus script usage, output truncation via max_length, and timeout behavior. It is materially incomplete for the tool's complexity.

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?

Schema description coverage is 0% for six parameters. The description explains only main_world and notes that script has an alias, leaving tab, expression, max_length, and timeout_ms unexplained. It does not compensate for the schema's lack of parameter documentation.

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 gives a specific verb and resource: "Evaluate JS." It also clarifies the default execution context (isolated world) and how to switch to page globals, which distinguishes behavior at a basic level. However, it does not distinguish this tool from siblings like extract or get_content.

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?

The only guidance is "Set main_world=True for page globals," which is parameter-specific rather than tool-selection guidance. There is no explicit when-to-use versus alternatives, no when-not-to-use, and no prerequisites or warnings about arbitrary code execution.

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