puppeteer_navigate
Automate URL navigation in browser workflows using Puppeteer. Specify the desired URL to initiate precise page loading for enhanced web interactions and testing.
Instructions
Navigate to a URL
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes |
Implementation Reference
- src/tools/handlers.ts:66-101 (handler)The core handler logic for the 'puppeteer_navigate' tool. Navigates the browser to the specified URL using Puppeteer's page.goto with networkidle0 wait condition and 30-second timeout. Includes comprehensive error handling for failed navigation, HTTP errors (4xx+), and network issues, returning structured success/error responses.case "puppeteer_navigate": try { logger.info('Navigating to URL', { url: args.url }); const response = await page.goto(args.url, { waitUntil: 'networkidle0', timeout: 30000 }); if (!response) { throw new Error('Navigation failed - no response received'); } const status = response.status(); if (status >= 400) { throw new Error(`HTTP error: ${status} ${response.statusText()}`); } logger.info('Navigation successful', { url: args.url, status }); return { content: [{ type: "text", text: `Successfully navigated to ${args.url} (Status: ${status})`, }], isError: false, }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); logger.error('Navigation failed', { url: args.url, error: errorMessage }); return { content: [{ type: "text", text: `Navigation failed: ${errorMessage}\nThis could be due to:\n- Network connectivity issues\n- Site blocking automated access\n- Page requiring authentication\n- Navigation timeout\n\nTry using a different URL or checking network connectivity.`, }], isError: true, }; }
- src/tools/definitions.ts:23-33 (schema)Tool schema definition including name, description, and input schema requiring a 'url' string parameter.{ name: "puppeteer_navigate", description: "Navigate to a URL", inputSchema: { type: "object", properties: { url: { type: "string" }, }, required: ["url"], }, },