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);

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