Skip to main content
Glama

eval

Execute JavaScript on a one-off page: loads url in a fresh browser context, optionally waits wait_secs for the page to settle, evaluates script (async/Promise supported) and returns {url, result}. Script-driven navigation (location.href, form submit) is drained and reflected in the returned url. Stateless — no cookies or page state shared with other calls; when the script needs prior page state or a login, use session_eval.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to load
scriptYesJavaScript code to execute (supports async/Promise)
wait_secsNoSeconds to wait before executing

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

The annotations provide only a title, so the description carries the full burden. It discloses all key behaviors: fresh browser context, optional wait, async/Promise support, the exact return shape {url, result}, and the fact that navigation is drained and reflected. It also states statelessness explicitly. There is no contradiction with the title annotation, and the description goes far beyond what annotations imply.

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 a single, tightly structured paragraph that leads with the core action and then covers the key details in logical order: context, wait, script, return, and navigation behavior. Every sentence adds essential information with no redundancy. It is front-loaded with the purpose and differentiator, making it easy for an agent to scan quickly.

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

Completeness5/5

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

The tool has no output schema, so the description must explain the return value, which it does ({url, result}). It covers all parameters, side effects (navigation), statelessness, and the alternative when state is needed. For a tool of this complexity, nothing essential is missing; an agent has everything needed to call it correctly and interpret the response.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

While the schema already describes each parameter (100% coverage), the description adds meaningful semantic value: it clarifies how wait_secs is used (optional, time to settle), that script supports async/Promise, and the return format. It also explains the interaction between script and the returned url (navigation). This goes beyond mere schema definitions, though not to the extent of a 5, since the schema already covers the basics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's core action: 'Execute JavaScript on a one-off page', followed by a precise breakdown of the flow (loads url, waits optionally, evaluates script, returns {url, result}). It also explicitly differentiates from the sibling tool session_eval by highlighting the stateless vs stateful distinction. This leaves no ambiguity about what the tool does or how it differs from alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use this tool (for one-off, stateless evaluations) and when not to use it, directly naming the alternative: 'when the script needs prior page state or a login, use session_eval.' It also explains the behavior around script-driven navigation, giving clear context for invocation. This is exemplary guidance for an agent to choose correctly.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.