Skip to main content
Glama

chrome_use_eval

Run JavaScript in a page's main world and return its result to inspect or change live state while page handlers fire.

Instructions

Run JavaScript in the page's main world (state persists, page handlers fire) and return its result.

Input Schema

NameRequiredDescriptionDefault
forceNoWith tabId: act on a tab this session does not own (the user's own, or another session's), in place and in the background (--tab <handle> --force). Only when the user asked you to act on that tab; the result has forced: true and the tab's title and url.
frameNoRun in this frame's context instead of the main frame (CSS selector, @ref, URL substring, or frame index).
tabIdNoTarget tab id (e.g. t2), label, or targetId (--tab).
scriptYesJavaScript to evaluate.
sessionNoIsolated session name (chrome-use --session <name>). Each session gets its own tab group, browser tab and element refs. Omit it unless several agents share ONE MCP server — the session is otherwise derived per agent automatically. When you do share a server with sibling agents, pass a name unique to you on every call, or you will drive their tabs and invalidate their refs.
timeoutMsNoKill the underlying chrome-use process if it hasn't responded after this many ms (default 30000).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the burden and does disclose meaningful behavior: main-world execution, persistent state, and that page handlers will fire. However, it does not disclose that arbitrary JS can mutate page state, how script exceptions are surfaced, or how non-serializable return values are handled.

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, context, key behavioral caveat, and return value with zero filler. Nothing redundant.

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 6-parameter tool whose parameters are fully documented in the schema and which has no output schema, the description covers the core action and its main-world semantics. The remaining gap is what 'return its result' means for complex or non-serializable values and errors.

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 100%, so every parameter including force, frame, tabId, and session is fully documented in structured data. The description adds no parameter-level detail beyond the schema, so the baseline 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 and resource ('Run JavaScript in the page's main world') and adds the execution context and return behavior. The 'main world' qualifier plus 'state persists, page handlers fire' makes it distinguishable from sibling tools like chrome_use_read or chrome_use_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 mention that state persists and page handlers fire implicitly signals when to use this over an isolated-world read, but there's no explicit when/when-not guidance or named alternative from the sibling list. An agent must infer the routing decision.

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