Skip to main content
Glama

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
NameRequiredDescriptionDefault
indexYesThe index of the tab to select

Implementation Reference

  • 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 }; },
  • 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', },
  • 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), ];

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Angeluis001/playwright-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server