browser_navigate
Direct a web browser to a specified URL for automated testing or interaction, using Playwright integration with Cloudflare Workers.
Instructions
Navigate to a URL
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The URL to navigate to |
Implementation Reference
- src/tools/navigate.ts:33-47 (handler)Handler function for browser_navigate tool: navigates the current tab to the specified URL using tab.navigate(), generates corresponding code snippet, and returns tool result.handle: async (context, params) => { const tab = await context.ensureTab(); await tab.navigate(params.url); const code = [ `// Navigate to ${params.url}`, `await page.goto('${params.url}');`, ]; return { code, captureSnapshot, waitForNetwork: false, }; },
- src/tools/navigate.ts:23-31 (schema)Schema definition for browser_navigate tool, including name, title, description, Zod input schema for URL, and destructive type.schema: { name: 'browser_navigate', title: 'Navigate to a URL', description: 'Navigate to a URL', inputSchema: z.object({ url: z.string().describe('The URL to navigate to'), }), type: 'destructive', },
- src/tools.ts:35-50 (registration)Registration of browser_navigate by including navigate(true) in the snapshotTools array.export const snapshotTools: Tool<any>[] = [ ...common(true), ...console, ...dialogs(true), ...files(true), ...install, ...keyboard(true), ...navigate(true), ...network, ...pdf, ...screenshot, ...snapshot, ...tabs(true), ...testing, ...wait(true), ];
- src/tools.ts:52-66 (registration)Registration of browser_navigate by including navigate(false) in the visionTools array.export const visionTools: Tool<any>[] = [ ...common(false), ...console, ...dialogs(false), ...files(false), ...install, ...keyboard(false), ...navigate(false), ...network, ...pdf, ...tabs(false), ...testing, ...vision, ...wait(false), ];