Skip to main content
Glama
devinwang

cloak-browser-mcp

by devinwang

browser_evaluate

Run a JavaScript function inside the current page to inspect or modify DOM state, optionally passing an element, and return a JSON-serializable value.

Instructions

Run a JavaScript function inside the page. Function source must be an arrow or function expression.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
targetNoIf set, runs the function with this element as argument.
elementNo
functionYesJS function source: must be an arrow or function expression. Receives the page (or element) and returns a JSON-serializable value.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full behavioral burden. It does not disclose that this executes arbitrary code in page context, whether it can mutate page state or side-effect the DOM, what happens on errors, or any security implications. For an arbitrary-execution tool this is a significant disclosure 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?

Two short sentences, zero waste, with the core action front-loaded. Nothing redundant is included.

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?

With no annotations and no output schema, the description must carry the full load, yet it omits the risk profile of arbitrary code execution, return behavior, and the purpose of the 'element' parameter. For a powerful eval tool with three parameters, this is under-specified.

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 67%: the 'function' and 'target' parameters have descriptions in the schema, while 'element' has none. The description repeats the arrow/function-expression constraint already present in the schema, adding little. Baseline 3 is appropriate given the schema does most of the work.

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 clear verb and resource: 'Run a JavaScript function inside the page.' An agent can understand the core action. However, it does not differentiate this tool from siblings like browser_snapshot, browser_find, or browser_click, which are the safer declarative alternatives for interacting with a page.

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 guidance on when to reach for this tool versus the many declarative browser_* siblings (click, type, find, snapshot). The only constraint given is about function syntax, not usage context. An agent gets no help deciding alternatives.

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