browser_tab_list
Retrieve and list active browser tabs for efficient tab management during web automation tasks using Playwright MCP server capabilities.
Instructions
List browser tabs
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/tabs.ts:20-45 (registration)Full tool definition using defineTool, including schema, handler, and registration of the browser_tab_list tool.const listTabs = defineTool({ capability: 'tabs', schema: { name: 'browser_tab_list', title: 'List tabs', description: 'List browser tabs', inputSchema: z.object({}), type: 'readOnly', }, handle: async context => { await context.ensureTab(); return { code: [`// <internal code to list tabs>`], captureSnapshot: false, waitForNetwork: false, resultOverride: { content: [{ type: 'text', text: await context.listTabsMarkdown(), }], }, }; }, });
- src/tools/tabs.ts:31-44 (handler)The handler function executes the tool logic: ensures a tab exists, generates markdown list of tabs via context.listTabsMarkdown(), and returns a result override with the content.handle: async context => { await context.ensureTab(); return { code: [`// <internal code to list tabs>`], captureSnapshot: false, waitForNetwork: false, resultOverride: { content: [{ type: 'text', text: await context.listTabsMarkdown(), }], }, }; },
- src/tools/tabs.ts:23-29 (schema)Input/output schema for the tool: no input parameters, readOnly type.schema: { name: 'browser_tab_list', title: 'List tabs', description: 'List browser tabs', inputSchema: z.object({}), type: 'readOnly', },
- src/tools/tabs.ts:129-134 (registration)Registration of the browser_tab_list tool (as listTabs) in the exported array of tab tools.export default (captureSnapshot: boolean) => [ listTabs, newTab(captureSnapshot), selectTab(captureSnapshot), closeTab(captureSnapshot), ];