Skip to main content
Glama
nolanbaxter

Local Browser MCP

by nolanbaxter

eval

Run JavaScript in the browser page and receive a JSON-serializable result, using the page's full privileges to read or modify live page state.

Instructions

Evaluate a JavaScript expression in the page context and return the JSON-serializable result. Runs with the page's full privileges — the client's own per-tool approval is the gate.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.0

TDQS

A3.8/5.0
Behavior4/5

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

Even though no annotations are provided, the description discloses meaningful behavioral traits: execution happens in page context, it runs with page-full privileges, the client's per-tool approval is the gate, and the result is JSON-serializable. This gives agents an appropriate sense of risk and output constraints, though it does not detail side effects or asynchronous behavior.

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?

Two short sentences carry the essential information with no filler. The core operation and return contract appear first, and the important security/privilege warning follows naturally. Every clause earns its place.

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 single-parameter, no-output-schema tool with no annotations, the description covers the operation, return format, and security model. It is adequate for an agent to invoke the tool safely, though it could be more complete with error or side-effect details. Overall it is strong given the tool's simplicity.

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 0%, so the description must compensate for the single 'expression' parameter. It adds that the value must be a JavaScript expression executed in page context and that its result must be JSON-serializable. This is helpful, but it leaves details like statement vs expression syntax, promise handling, and serialization failure behavior unaddressed.

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 description uses a specific verb ('Evaluate') and resource ('JavaScript expression in the page context'), and it distinguishes the tool from browser-automation siblings by focusing on code execution. It also clarifies the return type ('JSON-serializable result'). This uniquely identifies what eval does among the sibling set.

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?

No guidance is given about when to use eval versus alternatives, and there are no exclusions or conditions stated. The approval note explains permission context but does not help an agent decide when this tool is the right choice compared to console, get_text, or other siblings.

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