Skip to main content
Glama
lewisvoncken

Playwright MCP

by lewisvoncken

browser_install

Destructive

Install required browsers for Playwright automation when encountering installation errors, enabling web interaction through structured accessibility snapshots.

Instructions

Install the browser specified in the config. Call this if you get an error about the browser not being installed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function that forks the Playwright CLI to install the specified browser channel.
    handle: async context => {
      const channel = context.config.browser?.launchOptions?.channel ?? context.config.browser?.browserName ?? 'chrome';
      const cliUrl = import.meta.resolve('playwright/package.json');
      const cliPath = path.join(fileURLToPath(cliUrl), '..', 'cli.js');
      const child = fork(cliPath, ['install', channel], {
        stdio: 'pipe',
      });
      const output: string[] = [];
      child.stdout?.on('data', data => output.push(data.toString()));
      child.stderr?.on('data', data => output.push(data.toString()));
      await new Promise<void>((resolve, reject) => {
        child.on('close', code => {
          if (code === 0)
            resolve();
          else
            reject(new Error(`Failed to install browser: ${output.join('')}`));
        });
      });
      return {
        code: [`// Browser ${channel} installed`],
        captureSnapshot: false,
        waitForNetwork: false,
      };
    },
  • The schema definition for the browser_install tool, including name, title, description, input schema, and type.
    schema: {
      name: 'browser_install',
      title: 'Install the browser specified in the config',
      description: 'Install the browser specified in the config. Call this if you get an error about the browser not being installed.',
      inputSchema: z.object({}),
      type: 'destructive',
    },
  • The registration of the install tool by exporting it as default array.
    export default [
      install,
    ];
Behavior4/5

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

Annotations indicate destructiveHint=true and readOnlyHint=false, which the description aligns with by implying installation (a write operation). The description adds valuable context about error handling and prerequisites, though it doesn't detail installation behavior like time or system requirements.

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 two concise sentences that are front-loaded with the main purpose and followed by specific usage guidance. Every word contributes to understanding without redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter tool with annotations covering safety and world hints, the description is mostly complete. It explains purpose and usage well but lacks details on installation outcomes or error specifics, which could enhance completeness.

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?

With 0 parameters and 100% schema coverage, the baseline is 4. The description adds no parameter information, which is appropriate since there are no parameters to document, maintaining clarity.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Install') and resource ('browser specified in the config'), making the purpose understandable. It distinguishes from siblings by focusing on installation rather than browser interaction, though it doesn't explicitly name alternatives.

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 provides explicit guidance on when to use this tool: 'Call this if you get an error about the browser not being installed.' This gives clear context for invocation and distinguishes it from other browser tools that require an already-installed browser.

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

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