Skip to main content
Glama
mcp-server-visual-stack-browser

mcp-server-visual-stack-browser

by cadivus

execute_javascript

Runs JavaScript in the current browser page to inspect or manipulate it and returns the script result as text; set async to use await.

Instructions

Execute JavaScript in the current browser page. The return value of the script is returned as text. Set async to true to write code that uses await.

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": {
      "session_id": "<session_id>",
      "script": "<script>"
    },
    "name": "execute_javascript"
  }
}

Input Schema

NameRequiredDescriptionDefault
argsNoArguments available inside the script as the arguments array.
asyncNoWrap the script in an async function (enables await). Default: false.
scriptYesJavaScript source to run. Use `return` to produce a value.
session_idYesSession ID returned by start_browser.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description must carry the behavioral burden. It does disclose two things an agent could not otherwise assume: the script's return value comes back as text, and a `return` statement is needed to produce one. It says nothing about error/failure reporting, execution timeouts, or whether the script runs in the page's own JS context.

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 sentences, front-loaded with the core action and with zero filler. The only near-waste is the async sentence echoing the schema description for that property.

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

Completeness4/5

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

For a code-execution tool with no annotations and no output schema, the essentials are covered: where it runs, how a value comes back, and how to enable await. Missing but lower-priority details are error behavior and timeout/limits, which would help an agent handle failures.

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 100%, so all four parameters are already documented, including the args array and async wrapping. The description adds only the return-value mechanism, which is not captured by any parameter; the async sentence largely restates the 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?

States a concrete verb and resource: 'Execute JavaScript in the current browser page.' That cleanly distinguishes it from the DOM-interaction siblings (click_at_coordinates, type_text, press_key) as a general escape hatch, though it never names any sibling explicitly.

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?

No when-to-use or when-not guidance is offered. The phrase 'current browser page' and the session_id parameter imply a browser session must exist, but the description never states prerequisites or when an agent should prefer this over the dedicated click/type/navigate tools.

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