Skip to main content
Glama
nex-browser

NexBrowser MCP Server

Official
by nex-browser

nex_browser_run_code

Run custom JavaScript on a specific browser page or session to automate tasks, manipulate page content, and retrieve data when the runCode permission is enabled.

Instructions

Run page JavaScript when the separate runCode permission is enabled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
pageIdNoStable page ID; defaults to the session active page
sessionIdNoOptional session ID; defaults to this MCP client active session
Behavior2/5

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

With no annotations, the description carries the full burden. It discloses a permission requirement, but running JavaScript can be destructive and may have side effects; the description does not mention return values, whether the operation is safe/read-only, or potential risks. This is a significant gap for a code execution 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?

The description is a single sentence with no wasted words. It is concise, but it is also under-specified in content. Still, for length and front-loading, it is effective.

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?

The tool has 3 parameters, no output schema, and no annotations. It executes arbitrary page JavaScript, a powerful operation. The description only notes the permission requirement and fails to explain return behavior, side effects, or prerequisites beyond the permission. This is incomplete for the importance and complexity of the tool.

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?

The schema provides descriptions for pageId and sessionId, but the required 'code' parameter has no description. The description only says 'Run page JavaScript', which weakly implies the code is JavaScript but does not clarify format, size limits, or execution context. Schema coverage is 67%, but the description adds little meaningful parameter information.

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 clearly states the action ('Run page JavaScript') and a specific condition (when the separate runCode permission is enabled). However, it does not differentiate from sibling tool 'nex_browser_evaluate', which likely also executes code, so it lacks explicit sibling distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by requiring a specific permission ('when the separate runCode permission is enabled'), but it does not mention when not to use it or provide alternatives such as 'nex_browser_evaluate'. The usage context is partially clear but no exclusions are given.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nex-browser/nexbrowser-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server