Skip to main content
Glama

read_js

Destructive

Evaluate a JavaScript expression in the current page and return its value, enabling agents to read dynamic page state without navigation.

Instructions

Evaluate a JS expression in the page and return its value. This is arbitrary JavaScript: an expression can change page state, so treat it as an action and keep it for reading values only (disable with --no-eval).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already indicate destructive=true and readOnly=false; the description adds valuable context by explicitly warning that arbitrary JavaScript 'can change page state' and explaining that the tool should be treated as an action. The --no-eval flag is extra operational detail beyond the structured annotations.

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 sentences, front-loaded with the primary purpose, followed by a precise risk warning and operational hint. Every sentence earns its place with no filler.

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?

With an output schema present and a single, well-explained parameter, the description covers the key behavioral and safety aspects an agent needs. It might have mentioned that evaluation is synchronous or returns a JSON-serializable value, but those are minor given the output schema and annotations.

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?

The single parameter 'expression' has 0% schema description coverage, but the description defines it as a 'JS expression' and explains its behavior and risks. The parameter name and type string are self-explanatory, and the description adds the crucial arbitrary-code caveat, so it compensates for the missing schema description.

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 states a specific verb and resource: 'Evaluate a JS expression in the page and return its value.' It clearly identifies the tool's function and distinguishes it from navigation, clicking, and page-state tools by focusing on expression evaluation.

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

Usage Guidelines4/5

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

The description gives clear usage guidance: 'treat it as an action and keep it for reading values only' and mentions the --no-eval disable flag. It implies the tool should be used for reading rather than mutating state, though it does not name specific alternative sibling tools or explicit when-not-to-use conditions.

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