browser_navigate
Navigate to a specified URL with optional timeout and wait criteria. Use this tool to direct the browser to a web page for subsequent interaction.
Instructions
Navigate to a specific URL
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to navigate to | |
| timeout | No | Navigation timeout in milliseconds | |
| waitUntil | No | Navigation wait criteria |
Implementation Reference
- src/executor.ts:248-274 (handler)The actual handler function that executes the browser_navigate tool logic. Uses Playwright's page.goto() to navigate to a URL with configurable timeout and waitUntil options.
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)The input schema definition for browser_navigate. Defines the tool's name, description, and input schema with properties: url (required string), timeout (optional number), and waitUntil (optional string with enum values).
{ 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)The switch-case dispatch in executeToolCall() that routes the 'browser_navigate' tool name to the handleBrowserNavigate handler function.
case "browser_navigate": return await handleBrowserNavigate(activePage!, args); - src/tools.ts:3-12 (registration)The BROWSER_TOOLS constant list that includes 'browser_navigate' as one of the registered browser tool names.
export const BROWSER_TOOLS = [ "browser_navigate", "browser_screenshot", "browser_click", "browser_fill", "browser_select", "browser_hover", "browser_evaluate", "browser_set_viewport" ];