Skip to main content
Glama
NexBrowser MCP Server

NexBrowser MCP Server

Official
by nex-browser

nex_browser_run_code

Runs page JavaScript in a browser session when runCode permission is enabled. Supports CAPTCHA-related workflows through permitted tools without bypassing browser permissions.

Instructions

Run page JavaScript when the separate runCode permission is enabled. Page CAPTCHA: default to nex_captcha_product_schema, collect real page inputs with permitted tools, then use free nex_captcha_detect with productCode/adapter. Confirm application capability before NexCaptcha buy/query and apply the result in the original page. nex_browser_captcha_prepare is optional; never bypass browser permissions.

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": {
      "code": "<code>"
    },
    "name": "nex_browser_run_code"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes
pageIdNoDefaults to the active page
sessionIdNoDefaults to the active session

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2026.10.24
    • changedInput schema / properties / pageId / description
      Previous value: -"Stable page ID; defaults to the session active page"New value: +"Defaults to the active page"
    • changedInput schema / properties / sessionId / description
      Previous value: -"Optional session ID; defaults to this MCP client active session"New value: +"Defaults to the active session"
  2. Addedv2026.8.14

TDQS

C2.5/5.0
Behavior2/5

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

With no annotations, the description must carry the full behavioral burden. It usefully discloses the runCode permission prerequisite and warns never to bypass browser permissions, but says nothing about execution context, return values, error behavior, or side effects of arbitrary page JavaScript.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The first sentence is front-loaded and useful, but three of four sentences are a CAPTCHA workflow that is largely tangential to invoking run_code. That bulk dilutes the tool's actual purpose rather than helping the agent call it correctly.

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 powerful code-execution tool with no annotations, no output schema, and incomplete parameter documentation. The description leaves critical gaps about safety, outputs, and sibling choice, while spending most of its length on CAPTCHA orchestration that does not complete the run_code definition.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 67%, and the required code parameter has no schema description at all. The description only implies that code is page JavaScript and adds no format, scoping, or interaction details for code, pageId, or sessionId.

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 first sentence states a specific verb and resource: run page JavaScript, gated by a runCode permission. The purpose is clear, but it never distinguishes this tool from the sibling nex_browser_evaluate, which likely also executes JavaScript, so an agent cannot choose confidently between them.

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?

The only usage condition given is that the separate runCode permission must be enabled; there is no when-to-use guidance relative to nex_browser_evaluate or other execution tools. The long CAPTCHA workflow names sibling tools but does not tell the agent when to call nex_browser_run_code rather than those tools.

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

Deploy Server

Other Tools