pilot_navigate
Navigate to web URLs to retrieve HTTP status codes and final destination addresses for automated browsing tasks.
Instructions
Navigate to a URL. Returns HTTP status code and final URL.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to navigate to |
Implementation Reference
- src/tools/navigation.ts:8-26 (handler)The implementation of the pilot_navigate tool handler.
server.tool( 'pilot_navigate', 'Navigate to a URL. Returns HTTP status code and final URL.', { url: z.string().describe('URL to navigate to') }, async ({ url }) => { await bm.ensureBrowser(); try { await validateNavigationUrl(url); const page = bm.getPage(); const response = await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 15000 }); const status = response?.status() || 'unknown'; bm.resetFailures(); return { content: [{ type: 'text' as const, text: `Navigated to ${url} (${status})` }] }; } catch (err) { bm.incrementFailures(); return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true }; } } );