Skip to main content
Glama
nex-browser

NexBrowser MCP Server

Official
by nex-browser

nex_browser_run_code

Execute JavaScript in a specific browser page or session when the separate runCode permission is enabled. Use it to automate page actions and inspect live page state.

Instructions

Run page JavaScript when the separate runCode permission is enabled. Page CAPTCHA: start with nex_browser_captcha_prepare (free). Do not solve CAPTCHAs with CDP, Python, image matching or scripted drags.

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

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries full behavioral burden. It usefully discloses the runCode permission gate and an anti-pattern (don't script CAPTCHA solving), which is genuine behavioral context. But it says nothing about execution context, return value, timeouts, or side effects on the page for an arbitrary-code tool.

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?

Three short, front-loaded sentences with no filler, and the core action plus permission gate come first. The CAPTCHA sentences feel somewhat tangential to running code but are still compact and actionable.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a no-annotation, no-output-schema free-code-execution tool, an agent still lacks return-value, execution-context, and failure-mode information. The permission prerequisite and CAPTCHA routing are covered, but the execution semantics are not.

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%, with pageId and sessionId documented as defaulting to the active page/session; the required 'code' parameter is undocumented in both schema and description. The description adds no format, size, or context hints for the parameters, so it does not compensate for the gap.

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+resource: 'Run page JavaScript.' Clear enough that an agent knows the operation. However, it never distinguishes itself from the close sibling nex_browser_evaluate, which appears to do the same thing, so an agent cannot tell them apart without reading both schemas.

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?

Gives a real prerequisite ('when the separate runCode permission is enabled') and explicit alternatives/exclusions for CAPTCHA work ('start with nex_browser_captcha_prepare', 'Do not solve CAPTCHAs with CDP, Python, image matching or scripted drags'). Strong context, though the CAPTCHA routing is a specialty case rather than general when-to-use guidance.

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