Skip to main content
Glama
teifidebugger

Cloudflare Playwright MCP

execute-code

Run custom Playwright JavaScript code to automate browser interactions, extract page data, and handle console logs for web automation tasks.

Instructions

Execute custom Playwright JS code against the current page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe Playwright code to execute. Must be an async function declaration that takes a page parameter. Example: async function run(page) { console.log(await page.title()); return await page.title(); } Returns an object with: - result: The return value from your function - logs: Array of console logs from execution - errors: Array of any errors encountered Example response: {"result": "Google", "logs": ["[log] Google"], "errors": []}
Behavior3/5

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

With no annotations provided, the description carries full burden but only partially discloses behavioral traits. It mentions the execution environment (Playwright JS) and that code must be an async function with a page parameter, but lacks details on permissions needed, error handling beyond the response structure, rate limits, or whether execution modifies page state. The description adds some context but leaves significant behavioral aspects unspecified.

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 that directly states the tool's purpose with zero waste. It uses minimal words to convey essential information, making it highly efficient and easy to parse.

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 complexity (executing arbitrary code with potential side effects) and lack of annotations and output schema, the description is incomplete. It covers the basic purpose and parameter requirement but omits critical details like safety warnings, execution constraints, or expected output behavior beyond the schema's example, leaving gaps for an AI agent to use it correctly in varied contexts.

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%, so the schema already documents the single parameter 'code' with detailed examples and response format. The description adds no additional parameter semantics beyond what's in the schema, meeting the baseline of 3 for high schema coverage without extra value from the description.

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 specific action ('Execute custom Playwright JS code') and target resource ('against the current page'), distinguishing it from sibling tools that retrieve data or initialize the browser rather than executing code. It uses precise technical language that leaves no ambiguity about what the tool does.

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?

The description implies usage context by specifying 'against the current page,' suggesting it should be used after browser initialization and when you need to run custom JavaScript code. However, it doesn't explicitly state when NOT to use it or name alternatives among the sibling tools (e.g., when to use this vs. get-full-dom for DOM retrieval).

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/teifidebugger/playwright-mcp'

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