Skip to main content
Glama
chrome-fast
by ventos312

evaluate

Run JavaScript in the current Chrome page and return the last expression's value as text or JSON, including top-level await, multi-statement scripts, and DevTools $ / $$ helpers.

Instructions

Run JavaScript in the page and return the result as text (objects as JSON). Supports top-level await, several statements, and the DevTools console helpers $ and $$. Stops after 30 s.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "expression": "<expression>"
    },
    "name": "evaluate"
  }
}

Input Schema

NameRequiredDescriptionDefault
expressionYesJavaScript to evaluate; the value of the last expression is returned

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and delivers real behavior facts: serialization as JSON text, support for top-level await and multi-statement bodies, the $ and $$ console helpers, and a 30 s hard stop. It omits error surfacing and execution-context details (page world vs isolated world, side effects on the page), which keeps it short of a 5.

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?

Three short sentences, front-loaded with the action and return shape, followed by capability notes and the timeout. Every clause carries distinct information with no restatement of the name or title.

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?

For a one-parameter tool with no output schema, the description covers what an agent needs to invoke it: input format capabilities, return serialization, and the timeout. Levers left undocumented are failure behavior and where the code executes.

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?

Schema coverage is already 100%, so baseline is 3, but the description adds meaning the schema lacks: the expression may use top-level await, span several statements, and access $ / $$. That changes how an agent composes the single argument rather than merely restating it.

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 and resource ('Run JavaScript in the page') plus the return form ('result as text, objects as JSON'). No sibling tool (navigate, click, get_page, etc.) overlaps with arbitrary script execution, so the split is unambiguous.

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?

Usage is only implied: an agent infers this is the escape hatch for arbitrary in-page work, but the description never says when to prefer it over structured siblings like get_page or click, nor when to avoid it. No alternatives or prerequisites are named.

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