Skip to main content
Glama

browser_wait_for_navigation

Wait for page navigation to complete in a concurrent browser instance, ensuring scripts and resources load before proceeding with automated tasks.

Instructions

Wait for page navigation to complete

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instanceIdYesInstance ID
timeoutNoTimeout in milliseconds

Implementation Reference

  • The main handler function that executes the browser_wait_for_navigation tool logic. It retrieves the browser instance, waits for navigation using Playwright's waitForNavigation method with the given timeout, and returns success or error status with current URL.
    private async waitForNavigation(instanceId: string, timeout: number): Promise<ToolResult> {
      const instance = this.browserManager.getInstance(instanceId);
      if (!instance) {
        return { success: false, error: `Instance ${instanceId} not found` };
      }
    
      try {
        await instance.page.waitForNavigation({ timeout });
        return {
          success: true,
          data: { url: instance.page.url() },
          instanceId
        };
      } catch (error) {
        return {
          success: false,
          error: `Wait for navigation failed: ${error instanceof Error ? error.message : error}`,
          instanceId
        };
      }
    }
  • src/tools.ts:420-438 (registration)
    Registers the 'browser_wait_for_navigation' tool in the getTools() method, including its name, description, and input schema definition.
    {
      name: 'browser_wait_for_navigation',
      description: 'Wait for page navigation to complete',
      inputSchema: {
        type: 'object',
        properties: {
          instanceId: {
            type: 'string',
            description: 'Instance ID'
          },
          timeout: {
            type: 'number',
            description: 'Timeout in milliseconds',
            default: 30000
          }
        },
        required: ['instanceId']
      }
    },
  • Defines the input schema for the tool, specifying required instanceId and optional timeout.
    inputSchema: {
      type: 'object',
      properties: {
        instanceId: {
          type: 'string',
          description: 'Instance ID'
        },
        timeout: {
          type: 'number',
          description: 'Timeout in milliseconds',
          default: 30000
        }
      },
      required: ['instanceId']
    }
  • src/tools.ts:572-573 (registration)
    The switch case in executeTools() that handles the tool name and calls the corresponding handler method.
    case 'browser_wait_for_navigation':
      return await this.waitForNavigation(args.instanceId, args.timeout || 30000);
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions waiting for navigation completion but lacks details on behavioral traits: it doesn't specify what happens on timeout (e.g., error thrown, return status), whether it blocks until navigation finishes or times out, or if it handles redirects or multiple navigations. This is a significant gap for a tool with potential side effects.

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 directly states the tool's purpose without unnecessary words. It is front-loaded and every part of the sentence contributes to understanding the tool's function, making it highly concise and well-structured.

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 complexity of navigation waiting (which involves asynchronous behavior and potential errors), the description is incomplete. No output schema exists, so return values are undocumented. With no annotations and minimal description, it fails to cover critical aspects like error handling, success criteria, or interaction with other browser tools, leaving gaps for an AI agent.

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 100%, so the schema already documents both parameters (instanceId and timeout) with descriptions. The description adds no additional meaning beyond what the schema provides, such as explaining how timeout interacts with navigation events or why instanceId is required. Baseline 3 is appropriate when the schema does the heavy lifting.

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 ('wait for page navigation to complete'), which is a specific verb+resource combination. It distinguishes itself from siblings like browser_navigate (which initiates navigation) and browser_wait_for_element (which waits for elements rather than navigation events). However, it doesn't explicitly mention what constitutes 'complete' navigation (e.g., network idle, DOM ready), leaving some ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage after initiating navigation (e.g., with browser_navigate) but doesn't explicitly state when to use it versus alternatives. It doesn't mention prerequisites like needing an active browser instance or specify scenarios where this tool is necessary versus relying on implicit waits. No exclusions or clear alternatives are provided.

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/sailaoda/concurrent-browser-mcp'

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