Skip to main content
Glama
NexBrowser MCP Server

NexBrowser MCP Server

Official
by nex-browser

nex_browser_evaluate

Evaluate JavaScript expressions in the active or specified browser page and session when evaluate permission is enabled to inspect page state or run scripted checks.

Instructions

Evaluate JavaScript when the dedicated evaluate 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": {
      "expression": "<expression>"
    },
    "name": "nex_browser_evaluate"
  }
}

Input Schema

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

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

B3.3/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full disclosure burden. It does disclose the permission gate and the hard constraint 'never bypass browser permissions', plus an ordering rule for applying CAPTCHA results back in the original page. It does not describe what evaluation returns, what happens on a thrown error or on a missing permission, or the risk profile of executing arbitrary page-context JavaScript.

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

Conciseness3/5

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

The purpose is front-loaded correctly, which is good structure. But roughly three quarters of the text is a CAPTCHA playbook only tangentially related to evaluating JavaScript, so a large share of the description does not earn its place under this tool's name.

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?

Three parameters, no output schema, and no annotations, so the description must supply behavioral context on its own. It covers the permission prerequisite and cross-tool workflow, but leaves the return value, error behavior, and evaluation context unstated for a tool that executes arbitrary code in a live browser page.

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 already documented in the schema as defaulting to the active page and session. The undocumented 'expression' parameter is the required one, and the description adds nothing about its evaluation context, expected return type, or whether it must be a single expression versus a statement block. productCode/adapter is mentioned, but those belong to sibling tools, not this schema.

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 opening sentence gives a specific verb and resource: 'Evaluate JavaScript'. That is enough to distinguish it from most browser siblings such as nex_browser_click or nex_browser_get_text. The four sentences that follow switch to a CAPTCHA workflow and dilute the core purpose, so it stops short of a clean 5.

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?

It states a precondition ('when the dedicated evaluate permission is enabled') and routes the agent to nex_captcha_product_schema, nex_captcha_detect, and nex_browser_captcha_prepare for the CAPTCHA case. That is real routing guidance. However, it never explains when to use this tool instead of the closely related nex_browser_run_code, which is the most likely point of confusion for an agent choosing between the two.

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