navigate
Directs a browser to a specified URL, enabling automated web navigation and interaction for testing or data collection tasks.
Instructions
Navigate to a URL
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The URL to navigate to |
Implementation Reference
- tools-playwright.js:27-30 (handler)Handler function for the 'navigate' MCP tool. Destructures the input URL and delegates to the browser wrapper's navigate method, returning a success response with confirmation message.handler: async ({ url }) => { await browser.navigate(url); return { success: true, message: `Navigated to ${url}` }; }
- tools-playwright.js:20-26 (schema)Input schema definition for the 'navigate' tool, specifying a required 'url' parameter of type string.inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'The URL to navigate to' } }, required: ['url'] },
- tools-playwright.js:17-31 (registration)Complete registration object for the 'navigate' tool within the createPlaywrightTools function's returned array. This object is included in the main tools list used by the MCP server.{ name: 'navigate', description: 'Navigate to a URL', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'The URL to navigate to' } }, required: ['url'] }, handler: async ({ url }) => { await browser.navigate(url); return { success: true, message: `Navigated to ${url}` }; } },
- browser.js:64-67 (helper)Supporting 'navigate' method in SimpleBrowser class. Ensures browser is launched and uses Playwright's page.goto to navigate to the specified URL.async navigate(url) { await this.ensureLaunched(); await this.page.goto(url); }
- index.js:74-76 (registration)Final registration step in MCP server initialization: calls createTools (which includes 'navigate') to populate the tools array used in MCP tool listing and execution handlers.// Register all available automation tools const tools = createTools(browser);