Skip to main content
Glama

pmux_browser_eval

Evaluate a JavaScript expression in a browser tab and get the result with tab ID. A timeout or JS exception returns HTTP 409.

Instructions

Evaluate a JavaScript expression in the page and return { tabId, value } (CDP Runtime.evaluate, returnByValue + awaitPromise, 10s timeout). A JS exception/timeout surfaces as 409. Electron-only: 503 = not under Electron (hard); 409 'Browser tab not attached yet' = webview not dom-ready (transient, retry shortly).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tabIdYesTarget tab id (from pmux_list_tabs / pmux_create_tab).
expressionYesJavaScript expression evaluated in the page (CDP, 10s timeout).
workspaceIdYesTarget workspace id (from pmux_list_workspaces).
Behavior4/5

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

With no annotations, the description bears full burden. It discloses return format, CDP method, timeout, and specific error codes. However, it does not mention potential side effects of executing arbitrary JavaScript (e.g., state mutation), which is a notable gap.

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 exceptionally concise: two sentences front-loaded with core purpose, followed by error handling details. Every sentence adds value, with no redundancy.

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?

Given the absence of an output schema, the description covers main return format ({ tabId, value }) and error codes. It does not detail the type of 'value' (e.g., any JSON), but overall it is sufficiently complete for an evaluation tool.

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 coverage is 100% with descriptions for all three parameters. The description adds context about CDP and timeouts but largely overlaps with schema descriptions. Baseline 3 is appropriate as no significant extra semantic value is provided.

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 clearly states the action: 'Evaluate a JavaScript expression in the page and return { tabId, value }'. It specifies the underlying CDP method and options. However, it does not explicitly differentiate from sibling tools like pmux_browser_console or pmux_browser_url, though the unique evaluation capability is implied.

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 explicit guidance on error conditions (409 for exceptions/timeout, 503 for Electron-only) and transient retry logic. It does not explicitly state when to use this tool vs alternatives, but the context of JavaScript evaluation is distinct enough.

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

Install Server

Other Tools

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/yoway030/purplemux-mcp'

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