Skip to main content
Glama

chrome_evaluate

Execute JavaScript in an active Chrome tab, optionally targeting by URL or title, and retrieve JSON-serializable results for page inspection or automation.

Instructions

Evaluate JavaScript in an existing Chrome tab. Runs in the page context and returns JSON-serializable values.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetIdNoChrome tab id to target.
backgroundNoIf true, avoid explicit Chrome focus/tab activation (default). Pass false to allow foreground work.
expressionYes
urlIncludesNoMatch the target tab by URL substring.
awaitPromiseNoAwait a returned promise (default true).
titleIncludesNoMatch the target tab by title substring.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the disclosure burden. It usefully states that execution happens in the page context and that return values must be JSON-serializable. However, it does not warn that evaluating arbitrary JavaScript can mutate the page, navigate, trigger network activity, or throw on non-serializable values.

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?

A single front-loaded sentence that states the action, location, execution context, and return contract with no filler. Every phrase earns its place.

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?

For a 6-parameter arbitrary-JS execution tool with no annotations and no output schema, this is too sparse. It does not cover error behavior, side-effect risks, how targetId/urlIncludes/titleIncludes interact, or what happens for non-serializable results.

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 83%, so the schema already documents most parameters. The description adds context for the required 'expression' parameter by framing it as JavaScript that returns serializable values, but it does not add meaning for target selection or background/awaitPromise beyond the schema.

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?

The description names a specific verb ('Evaluate JavaScript'), the resource ('an existing Chrome tab'), and the result type ('JSON-serializable values'), making the core purpose unmistakable. It does not explicitly name or contrast sibling tools, but 'evaluate' is distinct from navigation/click/snapshot siblings.

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 'existing Chrome tab' implies the prerequisite that chrome_launch/chrome_tab must be used first and that this is for running code rather than inspecting or acting on the page. It provides no explicit when-to-use or when-not-to-use guidance and names no alternatives.

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