Skip to main content
Glama
Real Browser MCP

Real Browser MCP

by qxZap

Run JavaScript

browser_evaluate

Execute JavaScript in the current page context to inspect or manipulate the DOM and extract data during 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": {
      "script": "<script>"
    },
    "name": "browser_evaluate"
  }
}

Input Schema

NameRequiredDescriptionDefault
scriptYesJavaScript to execute

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full disclosure burden, and it says nothing about execution semantics: whether the script runs in the main world, whether promises/async results are awaited, how return values are serialized, or whether CSP restrictions apply. It also omits that arbitrary JS can mutate page state, which is a significant risk signal for an agent deciding whether to call it.

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?

A single front-loaded sentence with no filler. However, the brevity reflects under-specification rather than disciplined editing, so it does not reach 5.

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 high-power, potentially state-mutating tool with no annotations and no output schema, so the description must explain return behavior and safety context and does neither. An agent cannot predict whether it receives a serialized value, a promise, or nothing.

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?

Only one parameter exists and schema coverage is 100%, so the schema already documents 'script'. The phrase 'in the page context' adds a small amount of meaning about the execution environment but no syntax, return-value, or async conventions. Baseline 3 applies.

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?

States a specific verb and resource: 'Execute JavaScript in the page context.' That is unambiguous and distinct from siblings like browser_click or browser_get_content. It stops short of explicitly contrasting with siblings that also read page data, so a 4 rather than a 5.

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 choose this over browser_get_content, browser_search, or browser_wait, nor any warning about when it should not be used. The agent must infer that arbitrary script execution is the fallback for cases the structured tools cannot handle.

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