navigate
Automate web page navigation by directing browsers to specified URLs with options to wait for full page loads, powered by AutoProbeMCP's browser automation framework.
Instructions
Navigate to a URL
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to navigate to | |
| waitForLoad | No | Wait for page to fully load |
Implementation Reference
- src/index.ts:458-481 (handler)The main handler for the 'navigate' tool. Parses input arguments using NavigateSchema, checks if a page is available, navigates to the specified URL (with optional wait for network idle), retrieves the page title, and returns a text response with the URL and title.case 'navigate': { if (!currentPage) { throw new Error('No browser page available. Launch a browser first.'); } const params = NavigateSchema.parse(args); if (params.waitForLoad) { await currentPage.goto(params.url, { waitUntil: 'networkidle' }); } else { await currentPage.goto(params.url); } const title = await currentPage.title(); return { content: [ { type: 'text', text: `Navigated to ${params.url}\nPage title: ${title}` } ] }; }
- src/index.ts:23-26 (schema)Zod schema defining the input parameters for the 'navigate' tool: required URL (validated as string URL) and optional waitForLoad boolean (defaults to true). Used for input validation in the handler.const NavigateSchema = z.object({ url: z.string().url(), waitForLoad: z.boolean().default(true) });
- src/index.ts:158-176 (registration)Registration of the 'navigate' tool in the ListTools response, specifying name, description, and input schema matching the NavigateSchema.{ name: 'navigate', description: 'Navigate to a URL', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'URL to navigate to' }, waitForLoad: { type: 'boolean', default: true, description: 'Wait for page to fully load' } }, required: ['url'] } },