Skip to main content
Glama

browser_install

Destructive

Install the required browser for Playwright MCP to interact with web pages through structured accessibility snapshots, resolving 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 for the 'browser_install' tool that forks the Playwright CLI to install the specified browser channel, captures stdout/stderr, awaits completion, and handles errors by rejecting with output.
    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();
    },
  • Tool schema defining name 'browser_install', description, 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)
    Central registration of all tools by importing and spreading individual tool modules (including install) into the allTools array, which is filtered and used by the browser server backend.
    export const allTools: Tool<any>[] = [
      ...common,
      ...console,
      ...dialogs,
      ...evaluate,
      ...files,
      ...install,
      ...keyboard,
      ...navigate,
      ...network,
      ...mouse,
      ...pdf,
      ...screenshot,
      ...snapshot,
      ...tabs,
      ...wait,
    ];
  • The browser server backend imports filteredTools from tools.ts and assigns filtered tools to this._tools during construction, providing tools() and callTool for MCP server integration.
    import { filteredTools } from './tools.js';
    import { packageJSON } from './package.js';
    import { defineTool  } from './tools/tool.js';
    
    import type { Tool } from './tools/tool.js';
    import type { BrowserContextFactory } from './browserContextFactory.js';
    import type * as mcpServer from './mcp/server.js';
    import type { ServerBackend } from './mcp/server.js';
    
    type NonEmptyArray<T> = [T, ...T[]];
    
    export type FactoryList = NonEmptyArray<BrowserContextFactory>;
    
    export class BrowserServerBackend implements ServerBackend {
      name = 'Playwright';
      version = packageJSON.version;
    
      private _tools: Tool[];
      private _context: Context | undefined;
      private _sessionLog: SessionLog | undefined;
      private _config: FullConfig;
      private _browserContextFactory: BrowserContextFactory;
    
      constructor(config: FullConfig, factories: FactoryList) {
        this._config = config;
        this._browserContextFactory = factories[0];
        this._tools = filteredTools(config);
Behavior4/5

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

The description adds valuable context beyond annotations by specifying the trigger condition ('if you get an error about the browser not being installed'). Annotations already indicate this is a destructive, non-read-only operation with open-world implications, but the description provides practical usage context that helps the agent understand when this tool is needed.

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 consists of two concise sentences that each serve a clear purpose: the first states what the tool does, the second provides usage guidance. There's no wasted verbiage or unnecessary 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 (readOnlyHint, destructiveHint, openWorldHint), the description provides adequate context about when to use it. The lack of output schema isn't problematic here since the tool's purpose is installation rather than data retrieval. The description could potentially mention 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 is 4. The description appropriately doesn't discuss parameters since none exist, focusing instead on the tool's purpose and usage context.

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 ('the browser specified in the config'), making the purpose immediately understandable. It doesn't explicitly distinguish from sibling tools like browser_click or browser_navigate, but the installation function is distinct enough from typical browser interaction tools.

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 usage guidance: 'Call this if you get an error about the browser not being installed.' This gives clear context for when to invoke this tool versus alternatives, though it doesn't name specific sibling alternatives.

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

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