Skip to main content
Glama

Execute Script

execute

Run custom Playwright scripts to automate complex browser interactions, handling conditional logic and loops in a single call.

Instructions

Run a Playwright script with access to { page, context }. One tool call replaces 5-20 sequential MCP round trips. Use for complex flows with conditional logic, loops, error handling. NOTE: Scripts run in the Node.js process — equivalent to arbitrary code execution. Disable with LEAP_ALLOW_EXECUTE=false.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYes
scriptYesJavaScript async function body with access to { page, context }. Example: 'await page.goto("..."); return await page.title();'
timeoutNoTimeout in ms. Default: 60000, max: 300000.
Behavior5/5

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

Since no annotations are provided, the description carries full burden. It discloses that scripts run in the Node.js process with arbitrary code execution, a critical behavioral trait. It also mentions the LEAP_ALLOW_EXECUTE environment variable for disabling, ensuring transparency.

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 four concise sentences that front-load purpose and key usage guidance. Every sentence earns its place: purpose, efficiency claim, security warning, disable method. No redundant text.

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?

For a general script execution tool with no output schema, the description omits what the tool returns (e.g., the script's result). It provides an example in the schema but not in the description itself. Somewhat incomplete for an agent needing to understand the full I/O contract.

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 67% (script and timeout have descriptions, sessionId does not). The description adds no new parameter-level information beyond the schema's descriptions; it only contextualizes the script execution environment. Baseline of 3 is appropriate as the schema does most of the work.

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 clearly states the verb 'Run' and the resource 'Playwright script' with explicit access to { page, context }. It distinguishes from siblings by claiming one call replaces 5-20 sequential MCP round trips, making the purpose specific and differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly advises using this tool for complex flows with conditional logic, loops, and error handling. It provides context on efficiency gains and mentions the disable environment variable, offering clear guidance on when and how to use it.

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/anthonybono21-cloud/leapfrog'

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