browser_tab_new
Launch a new browser tab with a specified URL to facilitate automated accessibility scans, ensuring WCAG compliance and generating detailed remediation reports.
Instructions
Open a new tab
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | The URL to navigate to in the new tab. If not provided, the new tab will be blank. |
Implementation Reference
- src/tools/tabs.ts:35-60 (handler)The handler function for the 'browser_tabs' tool. For action 'new', it calls context.newTab() to create a new browser tab and includes tabs in the response.handle: async (context, params, response) => { switch (params.action) { case 'list': { await context.ensureTab(); response.setIncludeTabs(); return; } case 'new': { await context.newTab(); response.setIncludeTabs(); return; } case 'close': { await context.closeTab(params.index); response.setIncludeSnapshot(); return; } case 'select': { if (params.index === undefined) throw new Error('Tab index is required'); await context.selectTab(params.index); response.setIncludeSnapshot(); return; } } },
- src/tools/tabs.ts:25-34 (schema)The schema definition for the 'browser_tabs' tool, which supports 'new' action to create a new tab.schema: { name: 'browser_tabs', title: 'Manage tabs', description: 'List, create, close, or select a browser tab.', inputSchema: z.object({ action: z.enum(['list', 'new', 'close', 'select']).describe('Operation to perform'), index: z.number().optional().describe('Tab index, used for close/select. If omitted for close, current tab is closed.'), }), type: 'destructive', },
- src/context.ts:85-90 (helper)Core implementation of creating a new tab by calling browserContext.newPage() and updating current tab.async newTab(): Promise<Tab> { const { browserContext } = await this._ensureBrowserContext(); const page = await browserContext.newPage(); this._currentTab = this._tabs.find(t => t.page === page)!; return this._currentTab; }
- src/tools.ts:38-56 (registration)Registration of all tools, including the tabs tools (which exports browser_tabs) into the allTools array used by the MCP backend.export const allTools: Tool<any>[] = [ ...common, ...console, ...dialogs, ...evaluate, ...files, ...form, ...install, ...keyboard, ...navigate, ...network, ...mouse, ...pdf, ...screenshot, ...snapshot, ...tabs, ...wait, ...verify, ];
- src/tools.ts:30-30 (registration)Import of tabs module containing browser_tabs tool.import tabs from './tools/tabs.js';