Skip to main content
Glama
AbyvargheseMandapathel

Selenium MCP Server

execute_script

Executes custom JavaScript in the browser context, accepting arguments and returning the result to enable dynamic page manipulation and data extraction.

Instructions

Execute arbitrary JavaScript code in the browser page context and return the result.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNoArguments to pass to script (accessible via arguments[0], arguments[1], etc.)
scriptYesJavaScript code to execute in browser context. Use "return" to return values.
Install Server

TDQS

A3.5/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 the full behavioral burden. It usefully discloses that execution happens in the 'browser page context' and that a result is returned. However, it does not spell out side effects, destructive potential, serialization constraints, or how errors and async results are handled, which is meaningful 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.

Conciseness5/5

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

The description is a single, front-loaded sentence with no filler or redundancy. Every phrase contributes to understanding the tool's core purpose and execution context.

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?

With no output schema and no annotations, the description is the only behavioral contract beyond the parameter schema. It covers the essentials—executing arbitrary JavaScript and returning a result—but omits caveats an agent would benefit from when invoking arbitrary code, such as result serializability, error behavior, or side-effect warnings. This is adequate for basic invocation but not fully complete for a high-power execution tool.

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%, with both parameters already documented. The 'args' property even explains the arguments[0] convention, and the 'script' property explains the need to use 'return'. The tool description adds little parameter-level meaning beyond the schema, so the baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a clear verb and resource: 'Execute arbitrary JavaScript code in the browser page context' and promises to 'return the result.' This cleanly separates it from the sibling browser-automation tools, none of which expose arbitrary script execution.

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?

The description gives no explicit guidance on when to use this tool versus the available alternatives, such as click_element, get_page_content, or fill_element. The word 'arbitrary' hints at a catch-all capability, but there is no stated preference, exclusion, or prerequisite, leaving the routing decision entirely to the agent.

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

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/AbyvargheseMandapathel/Selenium-MCP-Server'

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