browser_navigate
Direct a browser to navigate to a specified URL, set navigation timeouts, and wait for specific page load criteria like 'load' or 'domcontentloaded' for precise control.
Instructions
Navigate to a specific URL
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timeout | No | Navigation timeout in milliseconds | |
| url | Yes | URL to navigate to | |
| waitUntil | No | Navigation wait criteria |
Implementation Reference
- src/executor.ts:248-274 (handler)Executes the browser navigation by calling page.goto with the provided URL, timeout, and waitUntil options. Returns success or error message.async function handleBrowserNavigate(page: Page, args: any): Promise<{ toolResult: CallToolResult }> { try { await page.goto(args.url, { timeout: args.timeout || 30000, waitUntil: args.waitUntil || "load" }); return { toolResult: { content: [{ type: "text", text: `Navigated to ${args.url}`, }], isError: false, }, }; } catch (error) { return { toolResult: { content: [{ type: "text", text: `Navigation failed: ${(error as Error).message}`, }], isError: true, }, }; } }
- src/tools.ts:37-53 (schema)Defines the tool name, description, and input schema requiring 'url' with optional 'timeout' and 'waitUntil' parameters.{ name: "browser_navigate", description: "Navigate to a specific URL", inputSchema: { type: "object", properties: { url: { type: "string", description: "URL to navigate to" }, timeout: { type: "number", description: "Navigation timeout in milliseconds" }, waitUntil: { type: "string", description: "Navigation wait criteria", enum: ["load", "domcontentloaded", "networkidle", "commit"] } }, required: ["url"] } },
- src/executor.ts:188-189 (registration)Registers the dispatch for 'browser_navigate' tool calls to the specific handler function within the main executeToolCall switch statement.case "browser_navigate": return await handleBrowserNavigate(activePage!, args);