Skip to main content
Glama

Execute Script

execute

Run custom Playwright scripts to replace 5-20 sequential browser operations with one call. Automate complex web flows using JavaScript with full page and context access for loops, conditions, and error handling in isolated sessions.

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.
Behavior4/5

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

No annotations provided, so description carries full burden. Critical disclosure: 'equivalent to arbitrary code execution' with environment variable to disable (LEAP_ALLOW_EXECUTE=false). Misses error handling behavior and return value format, but covers the essential security profile.

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?

Four sentences, zero waste: functionality, efficiency value, use-case guidance, security warning. Front-loaded with specific action, appropriately dense for a high-risk tool.

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?

High-complexity tool (arbitrary code execution) with no annotations or output schema. Description covers critical security aspect and use-case justification, but omits return value structure, error propagation behavior, and sessionId semantics.

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 coverage is 67% (script and timeout described, sessionId bare). Description adds context that script has access to '{ page, context }' but does not compensate for undocumented sessionId or mention timeout behavior. Baseline 3 appropriate given schema does most 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?

Specific verb-resource 'Run a Playwright script' plus explicit scope '{ page, context }'. Strong differentiation from granular siblings (act, navigate, etc.) by stating it replaces '5-20 sequential MCP round trips'.

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

Usage Guidelines4/5

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

Explicitly states 'Use for complex flows with conditional logic, loops, error handling', clearly positioning against simple atomic actions. Lacks explicit 'when not to use' or named alternatives, though implied by the efficiency comparison.

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