Skip to main content
Glama
AkhatorKing1

Playwright MCP Server

by AkhatorKing1

execute-code

Execute custom Playwright JavaScript code to automate browser interactions, extract data, and test web pages programmatically.

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 the full burden. It discloses that the tool executes code and implies mutation (since it interacts with the page), but lacks details on permissions, error handling, or performance impacts. The input schema's example hints at return structure, but the description itself doesn't explicitly cover behavioral traits like safety or side effects.

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 without unnecessary words. It efficiently communicates the core function, making it easy for an agent to quickly understand what the tool does.

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 (code execution with potential side effects) and no annotations or output schema, the description is minimally adequate. It covers the basic purpose but lacks details on usage context, error handling, or return values, which are crucial for safe and effective tool invocation.

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

Parameters4/5

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

Schema description coverage is 100%, so the baseline is 3. The description adds value by emphasizing the code must be 'Playwright JS' and target 'the current page', providing context beyond the schema's technical details. However, it doesn't elaborate on parameter constraints or usage nuances, keeping it at a 4.

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 ('against the current page'), distinguishing it from sibling tools that retrieve data or initialize the browser. It precisely communicates the tool's function without ambiguity.

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?

The description provides no guidance on when to use this tool versus alternatives like 'get-full-dom' or 'get-screenshot'. It lacks context about prerequisites (e.g., needing an initialized browser) or scenarios where code execution is preferred over simpler retrieval methods.

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

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