Skip to main content
Glama

evaluate

Run a JavaScript expression on the current page and return its value, enabling AI agents to inspect or extract data from the loaded browser page.

Instructions

Evaluate a JavaScript expression in the current page and return its value.

Input Schema

NameRequiredDescriptionDefault
expressionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.46

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full burden for an arbitrary-code-execution tool, yet it says nothing about side effects, whether the expression can mutate page state, whether it runs before or after page load, or how failures surface. It does at least anchor execution to 'the current page', which is minimal but useful context.

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?

One sentence, front-loaded with the action and ending with the return behavior; nothing is wasted. It is terse to the point of under-specification, but the structure itself is clean.

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?

No output schema exists, so the description should explain what 'its value' looks like when serialized (primitives vs. objects vs. DOM nodes) and how errors are returned. For a tool that executes arbitrary code, these omissions leave meaningful ambiguity for correct invocation.

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?

Schema description coverage is 0% for the single 'expression' parameter, so the description must compensate; it does partially by clarifying the value is a JavaScript expression whose result is returned. It adds no information on whether statements, multi-line bodies, or async expressions are accepted.

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?

States a specific verb and resource ('Evaluate a JavaScript expression in the current page') with the effect ('return its value'), which is far more informative than the bare name. It does not explicitly contrast with read_text/read_html, which are the obvious alternatives for extracting page content, so it falls short of full sibling differentiation.

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?

There is no guidance on when to choose this over read_text, read_html, or links, nor any warning about when not to use it. The agent must infer that this is for computed extraction that the other read tools cannot express.

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