browser_tab_list
Retrieve a list of active browser tabs for efficient management and navigation during web automation tasks with Playwright MCP.
Instructions
List browser tabs
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/tabs.ts:31-34 (handler)The handler function for the 'browser_tab_list' tool. Ensures a tab is available in the context and sets the response to include tabs.handle: async (context, params, response) => { await context.ensureTab(); response.setIncludeTabs(); },
- src/tools/tabs.ts:23-29 (schema)Schema definition for the 'browser_tab_list' tool, including name, title, description, empty input schema, and readOnly type.schema: { name: 'browser_tab_list', title: 'List tabs', description: 'List browser tabs', inputSchema: z.object({}), type: 'readOnly', },
- src/tools/tabs.ts:20-35 (registration)Local registration of the 'browser_tab_list' tool via defineTool, including capability, schema, and handler.const listTabs = defineTool({ capability: 'core-tabs', schema: { name: 'browser_tab_list', title: 'List tabs', description: 'List browser tabs', inputSchema: z.object({}), type: 'readOnly', }, handle: async (context, params, response) => { await context.ensureTab(); response.setIncludeTabs(); }, });
- src/tools.ts:36-52 (registration)Global registration: includes tabs tools (with 'browser_tab_list') in the allTools export array.export const allTools: Tool<any>[] = [ ...common, ...console, ...dialogs, ...evaluate, ...files, ...install, ...keyboard, ...navigate, ...network, ...mouse, ...pdf, ...screenshot, ...snapshot, ...tabs, ...wait, ];