Skip to main content
Glama

evaluate_js

Execute JavaScript code on the current page to test interactions or extract data in web applications.

Instructions

Evaluate a JavaScript string on the current web page (Supported on Web frameworks only).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior2/5

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

With no annotations, the description is the sole source of behavioral information. It does not disclose whether evaluation is sandboxed, can modify the page, returns a value, or has side effects. This is a significant gap for a tool that executes arbitrary code.

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, concise sentence that includes the core action and a necessary constraint in parentheses. It wastes no words and is easy to parse.

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?

The description provides enough for basic understanding, but omits details about output, failure modes, or security implications. For a tool with one parameter, the context is adequate but not comprehensive, especially given the arbitrary code execution nature.

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 only parameter, 'script', is described implicitly as a 'JavaScript string', which clarifies its type. However, it does not specify expected format, allowed content, error handling, or return value. Partial coverage of the parameter's meaning.

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 action (evaluate a JavaScript string) and the target (current web page), and includes a specific constraint ('Supported on Web frameworks only'). This leaves no ambiguity about the tool's purpose.

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 gives a conditional usage note (only on web frameworks), but does not explicitly contrast with sibling tools like navigate or click_element, nor does it state when custom JavaScript is preferred over other operations. The constraint provides partial guidance.

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