Skip to main content
Glama
b3nw
by b3nw

Navigate to URL

browser_navigate

Directs a web browser to load a specific URL and waits for the page to complete loading, enabling automated web navigation for testing or data collection.

Instructions

Navigate to a specified URL and wait for page load

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
waitUntilNodomcontentloaded

Implementation Reference

  • The anonymous async handler function for the browser_navigate tool. It validates the input parameters, ensures the Playwright browser is connected, navigates the page to the specified URL, and returns a success or error message.
    async (params: any) => {
      try {
        const input = z.object({
          url: z.string().url(),
          waitUntil: z.enum(['networkidle', 'domcontentloaded', 'load']).optional().default('domcontentloaded')
        }).parse(params);
        await this.playwright.ensureConnected();
        
        const page = this.playwright.getPage();
        await page.goto(input.url, { waitUntil: input.waitUntil });
        
        return {
          content: [{
            type: 'text',
            text: `Successfully navigated to ${page.url()}`
          }]
        };
      } catch (error) {
        return {
          content: [{
            type: 'text',
            text: `Navigation failed: ${error instanceof Error ? error.message : String(error)}`
          }],
          isError: true
        };
      }
  • src/server.ts:24-60 (registration)
    The MCP server registration of the 'browser_navigate' tool, including its metadata, inline input schema, and inline handler function.
      'browser_navigate',
      {
        title: 'Navigate to URL',
        description: 'Navigate to a specified URL and wait for page load',
        inputSchema: {
          url: z.string().url(),
          waitUntil: z.enum(['networkidle', 'domcontentloaded', 'load']).optional().default('domcontentloaded')
        }
      },
      async (params: any) => {
        try {
          const input = z.object({
            url: z.string().url(),
            waitUntil: z.enum(['networkidle', 'domcontentloaded', 'load']).optional().default('domcontentloaded')
          }).parse(params);
          await this.playwright.ensureConnected();
          
          const page = this.playwright.getPage();
          await page.goto(input.url, { waitUntil: input.waitUntil });
          
          return {
            content: [{
              type: 'text',
              text: `Successfully navigated to ${page.url()}`
            }]
          };
        } catch (error) {
          return {
            content: [{
              type: 'text',
              text: `Navigation failed: ${error instanceof Error ? error.message : String(error)}`
            }],
            isError: true
          };
        }
      }
    );
  • Zod input schema definition for the browser_navigate tool parameters.
    export const BrowserNavigateInputSchema = z.object({
      url: z.string().url(),
      waitUntil: z.enum(['networkidle', 'domcontentloaded', 'load']).optional().default('domcontentloaded')
    });
  • Key helper methods from PlaywrightManager used by the handler: ensureConnected() to maintain browser connection and getPage() to retrieve the current page instance.
    async ensureConnected(): Promise<void> {
      const connected = await this.isConnected();
      if (!connected) {
        await this.cleanup();
        await this.connect();
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'wait for page load' which hints at asynchronous behavior, but doesn't specify timeout handling, error conditions (e.g., invalid URLs, network failures), or what constitutes successful navigation. For a navigation tool with zero annotation coverage, this leaves significant behavioral gaps.

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 that states the core action and key behavioral aspect ('wait for page load'). Every word earns its place with no redundancy or unnecessary elaboration.

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?

Given the tool's complexity (navigation with asynchronous waiting), lack of annotations, and no output schema, the description is insufficient. It doesn't address error handling, return values, or the implications of different waitUntil options. For a browser navigation tool, more context about what constitutes success/failure is needed.

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?

Schema description coverage is 0%, so the description must compensate. It mentions 'specified URL' which maps to the 'url' parameter, and 'wait for page load' which relates to 'waitUntil', but doesn't explain the enum values or their practical differences. The description adds some meaning but doesn't fully compensate for the schema's lack of descriptions.

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 verb ('Navigate') and resource ('to a specified URL') with the action 'wait for page load'. It distinguishes from siblings like browser_click or browser_type by focusing on URL navigation rather than interaction or input. However, it doesn't explicitly differentiate from browser_refresh which also involves navigation.

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_refresh or browser_wait_for. It states what the tool does but offers no context about appropriate use cases, prerequisites, or exclusions.

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

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