Skip to main content
Glama

evaluate

Run a JavaScript expression in the active tab and return the JSON result to read page data other tools do not expose.

Instructions

Run a JavaScript expression in the active tab and return the JSON result. For reading data the other tools do not expose.

Input Schema

NameRequiredDescriptionDefault
expressionYesExpression or async IIFE, e.g. document.querySelectorAll('li').length

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 carries the full burden. It discloses the execution context (active tab) and return type (JSON), but says nothing about arbitrary code execution, potential DOM side effects, permissions, CSP restrictions, or whether the expression can mutate page state, which matters greatly for an eval-style tool.

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 compact sentences with the core capability front-loaded and the differentiation clause second. No filler and nothing redundant.

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?

For a one-parameter tool with full schema coverage and no output schema, explaining the JSON return value is adequate. The remaining gap is behavioral: the risks and side effects of running arbitrary JS in a live tab are left unstated.

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?

There is a single parameter with 100% schema description coverage, and the schema already supplies an example. The description adds no further syntax or format guidance beyond what the schema provides, so the baseline of 3 applies.

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?

States a specific verb (Run a JavaScript expression) and resource (the active tab) plus the return type (JSON result). The clause 'For reading data the other tools do not expose' distinguishes it from siblings like read and snapshot.

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 phrase 'data the other tools do not expose' implies it is a fallback for cases the read/snapshot tools cannot cover, which gives useful context. However, it names no specific alternative tool and gives no explicit when-not-to-use or precondition guidance.

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