Skip to main content
Glama

execute_script

Execute custom JavaScript in the browser to perform actions that standard Selenium commands do not support, such as manipulating page elements.

Instructions

Execute JavaScript in the browser.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
argsNo
scriptYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.0.0

TDQS

C2.4/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It adds only the location ('in the browser') and says nothing about whether the script's result is returned, how errors surface, whether execution is async, or that arbitrary scripts can modify or destroy page state. For an arbitrary-code-execution tool, this safety and behavior gap is significant.

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 single sentence is readable and front-loaded, but the brevity is under-specification rather than efficient density. It omits the parameter and behavioral details an agent needs; two or three well-chosen sentences would fit without bloat.

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?

With no output schema, no annotations, and 0% parameter coverage, the description is the agent's only source of truth, yet it fails to state the return value format, error behavior, page context, or side-effect risk. An agent cannot reliably verify success or predict consequences when invoking arbitrary code execution.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description does not compensate: it mentions neither 'script' nor 'args' and adds no syntax, scoping, or type guidance beyond the bare field names. An agent must guess how 'args' reaches the script (positional? named?) and what execution context 'script' runs in.

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 states a specific verb ('execute') and resource ('JavaScript in the browser'), which clearly conveys the tool's job. Within the large sibling set of element, navigation, and assertion commands, no other tool runs arbitrary JavaScript, so the purpose is naturally differentiated. A bit more specificity about execution context or return value would push this to a 5.

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?

There is no guidance on when to use this tool versus alternatives, no sibling tools are mentioned, and no exclusions or prerequisites are stated. With roughly 80 siblings covering clicks, navigation, and assertions, an agent gets no hint about when script execution is the right fallback or where it fits in a workflow.

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

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/hakanngul/testfly-mcp'

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