Skip to main content
Glama

js_execute

Execute JavaScript code directly in the browser. Automate interactions, test scripts, or manipulate the DOM for security testing.

Instructions

Execute JavaScript in the browser context

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
scriptYesJavaScript code to execute
Behavior2/5

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

No annotations provided, and the description omits critical behavioral traits like return value, error handling, execution limitations, or permission requirements. Minimal disclosure 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.

Conciseness4/5

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

Single sentence with no waste. Could benefit from a bit more detail (e.g., return value), but it is concise and front-loaded.

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?

Given the tool's simplicity (one param, no output schema), the description is minimally complete. However, it lacks any hints about use cases, prerequisites, or examples, leaving room for improvement.

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?

The input schema already describes the 'script' parameter as 'JavaScript code to execute'. The description adds no additional meaning, but schema coverage is 100%, so baseline 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 'Execute JavaScript in the browser context' clearly states the action and resource, distinguishing it from sibling tools like js_get_console_logs or dom_click.

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 information on when to use this tool vs alternatives (e.g., js_get_global_vars for reading, or dom_click for UI actions). Lacks any context or exclusions.

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

Install Server

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/D4D25A/PyPen'

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