Skip to main content
Glama
JackZhao98

chrome-automation-mcp

by JackZhao98

run_script

Execute JavaScript files from local disk or remote URLs with browser automation access to build complex, reusable workflows; provide scriptPath or scriptUrl.

Instructions

📁 Execute a JavaScript file from local disk path or remote URL with access to browser automation. Use for complex automation scripts or reusable workflows. Must provide either scriptPath OR scriptUrl (not both).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNoArguments to pass to the script. Common: {query: 'search term', url: 'target.com'}
scriptUrlNoRemote URL to the JavaScript file (e.g., 'https://example.com/scripts/automation.js'). Cannot be used with scriptPath.
sessionIdNoSession ID to use for script execution. If not provided, uses current session. If provided, will connect to the specified session's browser.
screenshotNoTake a screenshot after script execution. Default: false
scriptPathNoLocal disk path to the JavaScript file (e.g., 'scripts/login-workflow.js'). Cannot be used with scriptUrl.
autoCloseTabNoAutomatically close the tab after script completes (only works when createNewTab is true). Helps prevent tab accumulation.
createNewTabNoCreate a new tab for this script execution. Each script runs in isolation with its own tab. Useful for running multiple scripts in parallel without interference.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.8

TDQS

B3.1/5.0
Behavior2/5

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

With no annotations, the description carries the full behavioral burden, and it discloses only that the script gets browser-automation access. It says nothing about the fact that a remote URL means executing arbitrary third-party code, what happens on failure, timeout limits, or whether the script can mutate browser/session state.

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 action and resource, with the critical mutual-exclusivity constraint placed last for emphasis. The leading emoji is noise but does not materially bloat the text.

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?

For a 7-parameter tool that executes arbitrary code with no annotations and no output schema, the description should explain how results surface (return value, logs, screenshots) and any sandboxing or session implications. It leaves the agent guessing about the execution model beyond the source-of-script rule.

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 description coverage is 100%, so all seven parameters are already documented, including the scriptPath/scriptUrl conflict and the nested args object. The description's "either scriptPath OR scriptUrl (not both)" restates the schema's own constraint rather than adding new meaning, so the baseline 3 applies.

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 (Execute) and resource (a JavaScript file) plus the two accepted sources (local path or remote URL), which is concrete and unambiguous. It does not, however, differentiate itself from the obvious sibling run_script_background, which an agent must choose between.

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?

"Use for complex automation scripts or reusable workflows" gives a rough sense of when this tool fits, but offers no exclusions and never names the alternative (run_script_background for non-blocking execution, or navigate_to for simple navigation). The mutual-exclusivity rule is invocation guidance rather than 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.