Skip to main content
Glama

chrome_evaluate

Executes JavaScript in the browser page context and scans output for credential leaks; blocks page-writing expressions on read-only stealth domains such as LinkedIn.

Instructions

Execute JavaScript in page context. Output scanned for credential leaks. Read-only on stealth-only domains (LinkedIn): expressions that write to the page are refused, use chrome_type and chrome_click.

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": "chrome_evaluate"
  }
}

Input Schema

NameRequiredDescriptionDefault
expressionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.1.0

TDQS

A4/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 and does disclose two non-obvious behaviors: output is scanned for credential leaks (so results may be redacted or altered) and write expressions are refused on stealth-only domains. It says nothing about return value serialization, async/promise handling, timeouts, or error behavior, which matter a lot for an arbitrary-JS execution 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?

Three short sentences, front-loaded with the core action, then the security scanning note, then the domain-specific restriction and fallback. No filler and no repetition of the tool name.

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 annotations and no output schema, the description covers the essential safety and refusal semantics that an agent could not otherwise know. The remaining gap is return-value behavior, which is the main thing an agent needs to interpret results from arbitrary JS execution.

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?

The single parameter 'expression' has 0% schema description coverage, so the description must compensate. Saying 'Execute JavaScript' implies the parameter is JavaScript source, and the write-refusal note constrains what kinds of expressions are accepted, but there is no detail on whether it is an expression vs a statement, how the result is captured, or whether async code is supported.

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 ('Execute JavaScript in page context'), which unambiguously separates it from chrome_snapshot, chrome_page_info, and the other read-oriented siblings. It also names the sibling tools to use instead when the operation is a write.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit exclusion and the correct alternative: on stealth-only domains like LinkedIn, write expressions are refused and the agent should use chrome_type and chrome_click. It does not cover the general case of when to prefer chrome_evaluate over chrome_snapshot or chrome_page_info for reading page state, so it stops short of full routing guidance.

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