Skip to main content
Glama

chrome_evaluate

Executes JavaScript in a running Chrome tab to read or modify page state; supports promise awaiting and returning values for browser automation.

Instructions

Execute JavaScript in the page context

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
tabIdNo
expressionYesJavaScript expression to evaluate
awaitPromiseNoWait for promise to resolve (default: true)
returnByValueNoReturn result by value (default: true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.7/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full load of behavioral disclosure. It says nothing about side effects on the live page, whether execution is a mutation or a read, how the result is serialized, or what happens when the expression throws or the tab is missing. Calling this a read tool would be wrong, but the text never warns that it can change page state.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

One short sentence, front-loaded, with zero filler. It is efficient but there is no structure or supporting detail, so there is little left for the agent to anchor on beyond the core action.

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?

This is a powerful, side-effect-capable browser tool with four parameters, no annotations and no output schema. A six-word description leaves too much for the agent to infer: security constraints, execution context and failure behavior all go unaddressed.

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 75%: expression, awaitPromise and returnByValue each carry their own descriptions and defaults, while tabId is documented nowhere. The description adds no parameter meaning at all, so it does not make up for the undocumented tab selector, which determines which page gets the script.

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 states a concrete verb and resource: run JavaScript inside the page context. That is unmistakable, but it draws no line against sibling tools such as chrome_inject_script, so an agent cannot tell from the text alone which of the two it wants.

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

Usage Guidelines2/5

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

There is no when-to-use guidance, no mention of prerequisites such as an active tab, and no routing to alternatives like chrome_inject_script or chrome_get_text. The agent has to infer all of that from the name.

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