browser_tab_select
Select a specific browser tab by its index to control navigation and interactions within automated web browsing workflows using Playwright MCP.
Instructions
Select a tab by index
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes | The index of the tab to select |
Implementation Reference
- src/tools/tabs.ts:60-71 (handler)The handler function for 'browser_tab_select' that selects the tab at the given index using context.selectTab and returns a code snippet and execution options.handle: async (context, params) => { await context.selectTab(params.index); const code = [ `// <internal code to select tab ${params.index}>`, ]; return { code, captureSnapshot, waitForNetwork: false }; },
- src/tools/tabs.ts:50-58 (schema)The schema definition for the 'browser_tab_select' tool, including name, title, description, input schema (index: number), and type.schema: { name: 'browser_tab_select', title: 'Select a tab', description: 'Select a tab by index', inputSchema: z.object({ index: z.number().describe('The index of the tab to select'), }), type: 'readOnly', },
- src/tools/tabs.ts:129-134 (registration)The default export that registers and instantiates the 'browser_tab_select' tool (via selectTab(captureSnapshot)) along with other tab tools.export default (captureSnapshot: boolean) => [ listTabs, newTab(captureSnapshot), selectTab(captureSnapshot), closeTab(captureSnapshot), ];