navigate_page
Directs a Chrome browser page to a specific URL for automation, debugging, or testing workflows. Set a timeout to control navigation wait time.
Instructions
Navigates the currently selected page to a URL.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to navigate the page to | |
| timeout | No | Maximum wait time in milliseconds. If set to 0, the default timeout will be used. |
Implementation Reference
- src/tools/pages.ts:112-122 (handler)The handler function that executes the tool logic: gets the selected page and navigates to the provided URL using puppeteer-core's page.goto, with optional timeout.handler: async (request, response, context) => { const page = context.getSelectedPage(); await context.waitForEventsAfterAction(async () => { await page.goto(request.params.url, { timeout: request.params.timeout, }); }); response.setIncludePages(true); },
- src/tools/pages.ts:108-111 (schema)Zod schema for input parameters: required 'url' string and optional 'timeout' number from timeoutSchema.schema: { url: z.string().describe('URL to navigate the page to'), ...timeoutSchema, },
- src/main.ts:307-320 (registration)The navigate_page tool is registered by including all exports from pagesTools in the tools array, then looping to call registerTool for each, which registers it on the McpServer.const tools = [ ...Object.values(consoleTools), ...Object.values(emulationTools), ...Object.values(inputTools), ...Object.values(networkTools), ...Object.values(pagesTools), ...Object.values(performanceTools), ...Object.values(screenshotTools), ...Object.values(scriptTools), ...Object.values(snapshotTools), ]; for (const tool of tools) { registerTool(tool as unknown as ToolDefinition); }