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);
    }
Behavior3/5

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

Annotations already indicate this is a destructive (destructiveHint: true) and open-world (openWorldHint: true) operation, but the description adds minimal context beyond that. It doesn't explain what 'destructive' means in this context (e.g., navigating away from current page loses state) or mention potential side effects like page loads or navigation errors.

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 at just three words, front-loading the core action without any wasted text. Every word earns its place, making it easy to parse quickly.

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

Completeness2/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 output schema and rich annotations, the description is insufficient. It doesn't explain what happens after navigation (e.g., page load completion, potential errors) or how it interacts with other browser tools, leaving gaps in understanding the tool's full 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?

With 100% schema description coverage, the input schema fully documents the single 'url' parameter. The description adds no additional meaning beyond what's in the schema, so it meets the baseline for high coverage without compensating value.

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 verb ('Navigate') and resource ('URL'), making the purpose immediately understandable. However, it doesn't distinguish this tool from its sibling 'browser_navigate_back', which also involves navigation but in a different direction.

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 like 'browser_navigate_back' or other browser interaction tools. There's no mention of prerequisites (e.g., needing an open browser session) or typical use cases (e.g., loading a webpage).

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