Skip to main content
Glama
nzjami

Playwright MCP

by nzjami

browser_navigate

Destructive

Navigate web browsers to specified URLs for automated testing and interaction with web pages using Playwright's browser automation capabilities.

Instructions

Navigate to a URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to navigate to

Implementation Reference

  • The main handler function that implements the logic for the 'browser_navigate' tool: ensures a tab is available, navigates to the specified URL using tab.navigate(), includes a snapshot in the response, and adds Playwright code snippets for reproduction.
    handle: async (context, params, response) => {
      const tab = await context.ensureTab();
      await tab.navigate(params.url);
    
      response.setIncludeSnapshot();
      response.addCode(`// Navigate to ${params.url}`);
      response.addCode(`await page.goto('${params.url}');`);
    },
  • The schema definition for the 'browser_navigate' tool, specifying the tool name, title, description, Zod input schema requiring a 'url' string, and marking it as a destructive operation.
    schema: {
      name: 'browser_navigate',
      title: 'Navigate to a URL',
      description: 'Navigate to a URL',
      inputSchema: z.object({
        url: z.string().describe('The URL to navigate to'),
      }),
      type: 'destructive',
    },
  • src/tools.ts:36-52 (registration)
    Registration of the 'browser_navigate' tool by importing the navigate module (line 24, not shown) and including it via spread operator in the allTools array, which collects all available tools for the backend.
    export const allTools: Tool<any>[] = [
      ...common,
      ...console,
      ...dialogs,
      ...evaluate,
      ...files,
      ...install,
      ...keyboard,
      ...navigate,
      ...network,
      ...mouse,
      ...pdf,
      ...screenshot,
      ...snapshot,
      ...tabs,
      ...wait,
    ];
  • MCP server backend's callTool method that dispatches tool calls by name: finds the tool by schema.name ('browser_navigate'), invokes its handle function with context and arguments, and serializes the response.
    async callTool(schema: mcpServer.ToolSchema<any>, parsedArguments: any) {
      const response = new Response(this._context, schema.name, parsedArguments);
      const tool = this._tools.find(tool => tool.schema.name === schema.name)!;
      await tool.handle(this._context, parsedArguments, response);
      if (this._sessionLog)
        await this._sessionLog.log(response);
      return await response.serialize();
    }
  • Initialization of the tool list in the BrowserServerBackend constructor by calling filteredTools(config), which includes 'browser_navigate' based on capabilities, and passes tools to Context.
    constructor(config: FullConfig, browserContextFactory: BrowserContextFactory) {
      this._tools = filteredTools(config);
      this._context = new Context(this._tools, config, browserContextFactory);
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.3/5.0
Behavior3/5

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

Annotations indicate destructiveHint=true and readOnlyHint=false, which the description does not contradict. However, the description adds minimal behavioral context beyond annotations—it implies navigation but does not specify effects like page loading, error handling, or browser state changes. With annotations covering safety, a baseline 3 is appropriate as the description adds little extra value.

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, efficient sentence with no wasted words. It is appropriately sized for a simple tool and front-loaded with the core action, making it easy to understand quickly.

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 low complexity (one parameter) and rich annotations (destructiveHint, openWorldHint), the description is minimally adequate. However, with no output schema and the description lacking details on return values or navigation outcomes, it leaves gaps in understanding the full tool behavior.

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

Parameters3/5

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

The input schema has 100% description coverage, with the 'url' parameter fully documented. The description does not add any meaning beyond the schema, such as URL format requirements or navigation behavior details. Baseline 3 is correct when the schema handles all parameter documentation.

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 'Navigate to a URL' clearly states the action (navigate) and target (URL), making the purpose understandable. However, it does not differentiate from sibling tools like 'browser_navigate_back' or 'browser_navigate_forward', which are related navigation actions, so it lacks sibling distinction.

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. It does not mention when to choose this over other navigation tools like 'browser_navigate_back' or 'browser_navigate_forward', nor does it specify any prerequisites or exclusions for usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.