Skip to main content
Glama
otaviosenne

chrome-agent-mcp

by otaviosenne

browser_evaluate

Execute JavaScript in a live page to read or modify its state, extract data, or drive interactions. Target a specific tab or use an agent ID for parallel execution.

Instructions

Evaluate JavaScript in a page context. IMPORTANT: top-level const/let/var declarations persist across calls — always wrap multi-statement code in an IIFE: (() => { const x = ...; return x; })(). Never use bare 'return' at top level. Max timeout: 10s — avoid setTimeout > 10000ms. Supports targeting a specific tab via tabId.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tabIdNoTarget tab ID (from browser_tabs list). Uses active tab if omitted.
agentIdNoAgent identifier for parallel execution. Pass a unique ID (e.g. 'C1', 'J2') — the server automatically routes calls to this agent's dedicated tab (registered via browser_tabs action=new).
expressionYesJavaScript expression or IIFE to evaluate

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.0.0

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It reveals non-obvious execution traits: top-level const/let/var declarations persist across calls and the hard 10s timeout, plus the IIFE workaround. These are exactly the kind of details an agent cannot infer from the tool name or schema.

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?

The description is compact, front-loaded with the core purpose, and every sentence adds information. The critical caveats (IIFE, no bare return, 10s timeout) are presented immediately after the purpose with no filler or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Because there is no output schema and no annotations, an agent is left to infer return values, promise/async handling, and timeout/error behavior. The description covers execution mechanics well, but it does not say what the tool returns or how failures surface, so it is not fully complete.

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?

The schema already describes all three parameters with 100% coverage, so the baseline is 3. The description adds meaningful semantics for the expression parameter: state persistence across calls, the IIFE requirement, the ban on bare return, and the timeout constraint. The tabId mention is useful but largely redundant with the schema.

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?

The first sentence states the action and object clearly: 'Evaluate JavaScript in a page context.' This is specific enough to separate it from navigation, snapshot, and form-filling sibling tools, and the later tabId mention confirms it operates in a browser page.

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?

The description gives clear invocation context (evaluate JS in a page, optionally targeting a tab) and provides crucial rules for correct use: wrap multi-statement code in an IIFE to avoid state leakage, never use bare top-level return, and respect the 10s timeout. It does not name an alternative tool or an explicit 'when not to use', so it falls short of a 5.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/otaviosenne/chrome-agent-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server