Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

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

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/lewisvoncken/playwright-mcp'

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