Skip to main content
Glama
Angeluis001

Playwright MCP

by Angeluis001

browser_install

Destructive

Install the required browser when encountering a 'browser not installed' error in Playwright MCP for web automation tasks.

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 executes the browser installation by forking the Playwright CLI 'install' command for the browser channel specified in the config (defaults to 'chrome'). It captures output and returns a success message.
    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 defines the tool name 'browser_install', its title, description, an empty input schema (no parameters), and marks it as 'destructive'.
    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 tool is assigned to const install via defineTool and exported as a default array, allowing it to be imported and spread into central tools lists (e.g., snapshotTools and visionTools in src/tools.ts).
    export default [
      install,
    ];
  • src/tools.ts:21-21 (registration)
    Imports the install tool module containing 'browser_install'.
    import install from './tools/install.js';
  • src/tools.ts:35-50 (registration)
    Spreads the install tools (including 'browser_install') into the snapshotTools array for registration.
    export const snapshotTools: Tool<any>[] = [
      ...common(true),
      ...console,
      ...dialogs(true),
      ...files(true),
      ...install,
      ...keyboard(true),
      ...navigate(true),
      ...network,
      ...pdf,
      ...screenshot,
      ...snapshot,
      ...tabs(true),
      ...testing,
      ...wait(true),
    ];
Behavior4/5

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

Annotations already indicate destructiveHint=true and readOnlyHint=false, which the description doesn't contradict. The description adds valuable context about when to use the tool (error recovery scenario) that goes beyond what annotations provide. However, it doesn't mention potential side effects like system changes or installation time, which would be helpful additional behavioral context.

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?

Two sentences, zero waste. The first sentence states the purpose, the second provides usage guidance. Every word earns its place, and the most important information (what it does) comes first.

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 destructive tool with no parameters and no output schema, the description provides good context about purpose and usage. However, it doesn't mention what 'the config' refers to or what happens after installation (e.g., whether browser becomes available immediately), leaving some contextual gaps despite the tool's simplicity.

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 instead focuses on the tool's purpose and usage context, which adds semantic value beyond the empty schema.

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 ('the browser specified in the config'), distinguishing it from all sibling tools which are browser interaction commands rather than setup/installation tools. It provides explicit differentiation by focusing on installation rather than runtime operations.

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 when-to-use guidance: 'Call this if you get an error about the browser not being installed.' This gives clear context for invocation and implicitly suggests alternatives (don't call it unless you encounter that specific error condition).

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

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