playwright_navigate
Automatically navigate to a specified URL using Playwright via the MCP Browser Automation Server, enabling streamlined web interaction and task automation.
Instructions
Navigate to a URL
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes |
Implementation Reference
- src/toolsHandler.ts:63-88 (handler)The switch case that handles the 'playwright_navigate' tool call, performing navigation using Playwright's page.goto method with optional timeout and waitUntil options.case "playwright_navigate": try { await page!.goto(args.url, { timeout: args.timeout || 30000, waitUntil: args.waitUntil || "load" }); return { toolResult: { content: [{ type: "text", text: `Navigated to ${args.url} with ${args.waitUntil || "load"} wait`, }], isError: false, }, }; } catch (error) { return { toolResult: { content: [{ type: "text", text: `Navigation failed: ${(error as Error).message}`, }], isError: true, }, }; }
- src/tools.ts:5-15 (schema)The tool schema definition for 'playwright_navigate', specifying the input schema requiring a 'url' parameter.{ name: "playwright_navigate", description: "Navigate to a URL", inputSchema: { type: "object", properties: { url: { type: "string" }, }, required: ["url"], }, },
- src/tools.ts:152-160 (helper)Array of browser-requiring tools that includes 'playwright_navigate', used to determine if browser should be launched.export const BROWSER_TOOLS = [ "playwright_navigate", "playwright_screenshot", "playwright_click", "playwright_fill", "playwright_select", "playwright_hover", "playwright_evaluate" ];