Skip to main content
Glama

evaluate

Run JavaScript in the active browser tab and return a JSON-serializable result, enabling custom page data extraction or interaction when snapshot/query tools are insufficient.

Instructions

Run JavaScript in the page and return the JSON-serializable result. Powerful; prefer snapshot/query when possible.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tabIdNo
scriptYesJS expression or statements; use "return x" for a value

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.1

TDQS

B3.3/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does disclose the return contract (JSON-serializable result) and flags the tool as "Powerful," which is genuine context, but it says nothing about side effects, page-state mutation, permissions, or execution constraints.

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 short clauses, front-loaded with the capability before the caution. Nothing wasted.

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 2-param tool with no output schema, the return behavior is covered by the description. The remaining gaps — tabId semantics and the consequences of executing arbitrary JS — are meaningful for an eval tool but not fatal.

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

Parameters2/5

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

Schema coverage is 50% and the description adds no parameter meaning at all — notably, tabId is undocumented in both schema and description, leaving the agent to guess which page the script runs in. The script description in the schema already covers the return-value idiom.

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+resource: run JavaScript in the page and return the serializable result. It also names the siblings it overlaps with (snapshot, query), which helps an agent separate it from read-only inspection tools.

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?

"prefer snapshot/query when possible" gives a real routing hint toward the alternatives, but the condition is vague — it never says when evaluate IS the right choice, nor when it is unsafe or unnecessary. Adequate but incomplete.

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