navigate
Navigate the active browser tab to a specified URL, enabling automated page loading and interaction for web tasks.
Instructions
Navigate the active tab to a URL.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes |
Implementation Reference
- src/index.ts:307-311 (handler)The navigate handler function that receives a URL and uses Playwright's page.goto to navigate the active tab. Returns the resulting URL and page title.
async function navigate(args: { url: string }) { const p = requirePage(); await p.goto(args.url, { waitUntil: 'domcontentloaded', timeout: 20000 }); return { url: p.url(), title: await p.title().catch(() => '') }; } - src/index.ts:417-421 (schema)The input schema for the navigate tool, defining url as a required string property.
inputSchema: { type: 'object', properties: { url: { type: 'string' } }, required: ['url'], }, - src/index.ts:414-422 (registration)The tool registration within the TOOLS array, containing the name 'navigate' and its description.
{ name: 'navigate', description: 'Navigate the active tab to a URL.', inputSchema: { type: 'object', properties: { url: { type: 'string' } }, required: ['url'], }, }, - src/index.ts:468-468 (registration)The switch-case dispatch routing the 'navigate' tool call to the navigate function.
case 'navigate': result = await navigate(args as { url: string }); break;