Skip to main content
Glama
nzjami

Playwright MCP

by nzjami

browser_install

Destructive

Install the required browser for Playwright MCP's automation tasks when encountering browser not installed errors.

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 handler function that forks the Playwright CLI process to install the browser channel specified in the config (defaults to 'chrome'). Captures output and rejects on non-zero exit code.
    handle: async (context, params, response) => {
      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('')}`));
        });
      });
      response.setIncludeTabs();
    },
  • The tool schema defining name 'browser_install', empty input schema (no parameters), and destructive 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',
    },
  • src/tools.ts:36-52 (registration)
    Registers browser_install by spreading the install tools array into the global allTools list used by the backend.
    export const allTools: Tool<any>[] = [
      ...common,
      ...console,
      ...dialogs,
      ...evaluate,
      ...files,
      ...install,
      ...keyboard,
      ...navigate,
      ...network,
      ...mouse,
      ...pdf,
      ...screenshot,
      ...snapshot,
      ...tabs,
      ...wait,
    ];
  • The MCP ServerBackend.tools() method exposes the tool schemas (including browser_install) to the MCP server.
    tools(): mcpServer.ToolSchema<any>[] {
      return this._tools.map(tool => tool.schema);
    }
  • Initializes the backend's _tools list using filteredTools(config), which includes core-install capability tools like browser_install.
    constructor(config: FullConfig, browserContextFactory: BrowserContextFactory) {
      this._tools = filteredTools(config);
Behavior4/5

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

The description adds valuable context about when to call the tool (in response to installation errors), which goes beyond what annotations provide. Annotations already indicate this is a destructive, non-read-only operation with open-world characteristics, but the description provides practical usage context that helps the agent understand when this destructive operation is appropriate.

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 extremely concise (two sentences) with zero wasted words. The first sentence states the purpose, the second provides usage guidance - both sentences earn their place by providing essential information.

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 comprehensive annotations, the description provides complete guidance on purpose and usage context. While there's no output schema, the description doesn't need to explain return values for an installation operation. The only minor gap is not explicitly mentioning what happens after installation completes.

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 description coverage, the baseline would be 4. The description appropriately doesn't discuss parameters since there are none, and the schema fully documents the empty parameter structure.

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 ('Install') and resource ('browser specified in the config'), and distinguishes it from all sibling tools which perform browser interaction operations rather than installation. It provides a concrete purpose that goes beyond just restating the name.

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 states when to use this tool ('if you get an error about the browser not being installed'), providing clear contextual guidance. It also implicitly distinguishes from sibling tools by focusing on installation rather than browser interaction operations.

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/nzjami/mcpPlaywright'

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