Skip to main content
Glama
BrowserGenie

BrowserGenie MCP Server

by BrowserGenie

list_tabs

Retrieve all open browser tabs, including their IDs, URLs, titles, and active status. Useful for finding specific pages or obtaining tab identifiers for further automation.

Instructions

Get a list of ALL open browser tabs. Use this to find tab IDs, see what pages are open, or locate a specific website you need to interact with. Returns tab ID, URL, title, and active status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiKeyNoAPI key for authentication if enabled

Implementation Reference

  • The handler function for the 'list_tabs' tool. It sends a 'list_tabs' command via the WebSocket bridge and returns the list of browser tabs as formatted JSON.
      async ({ apiKey }) => {
        const result = await bridge.sendCommand({
          command: 'list_tabs',
          params: {},
          apiKey,
        });
        if (!result.success) {
          return { content: [{ type: 'text', text: `Error: ${result.error?.message}` }], isError: true };
        }
        return { content: [{ type: 'text', text: JSON.stringify(result.data, null, 2) }] };
      }
    );
  • The tool registration and schema definition for 'list_tabs'. Registers the tool with the MCP server using the McpServer SDK, with an optional 'apiKey' parameter described via Zod schema.
    server.tool(
      'list_tabs',
      'Get a list of ALL open browser tabs. Use this to find tab IDs, see what pages are open, or locate a specific website you need to interact with. Returns tab ID, URL, title, and active status.',
      {
        apiKey: z.string().optional().describe('API key for authentication if enabled'),
      },
  • Registration of the tab management tools (including list_tabs) via the registerAllTools function, which is called from createServer in server.ts.
    registerTabManagementTools(server, bridge);
  • The WebSocketBridge.sendCommand helper that the list_tabs handler calls to relay the 'list_tabs' command to the Chrome extension over WebSocket.
    async sendCommand(cmd: BridgeCommand): Promise<BridgeResponse> {
      if (!this.isConnected()) {
        return {
          success: false,
          error: {
            code: 'NOT_CONNECTED',
            message: 'Chrome extension is not connected. Ensure the extension is installed, enabled, and the browser is running.',
          },
        };
      }
    
      const id = crypto.randomUUID();
      const timeout = cmd.timeout ?? DEFAULT_TIMEOUT;
    
      return new Promise<BridgeResponse>((resolve, reject) => {
        const timer = setTimeout(() => {
          this.pending.delete(id);
          resolve({
            success: false,
            error: {
              code: 'TIMEOUT',
              message: `Command '${cmd.command}' timed out after ${timeout}ms`,
            },
          });
        }, timeout);
    
        this.pending.set(id, { resolve, reject, timer });
    
        const message = {
          id,
          type: 'request',
          command: cmd.command,
          params: cmd.params,
          tabId: cmd.tabId,
          apiKey: cmd.apiKey,
          timestamp: Date.now(),
        };
    
        this.client!.send(JSON.stringify(message));
      });
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided; description covers key behavioral traits (lists returned data) but lacks details on side effects, authentication (apiKey parameter not referenced), or rate limits. Adequate for a simple read operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences, each adding value. No redundancy. Front-loaded with key action and use cases.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool is simple (0 required params, no output schema); description adequately explains what it does and what it returns, compensating for lack of output schema by listing fields. Sibling tools are numerous but context is sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with one parameter (apiKey) fully described in schema. Description adds no additional meaning for this parameter, so baseline score applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it retrieves all open browser tabs, listing returned fields (tab ID, URL, title, active status). Distinguishes from sibling tools like get_tab_order, get_tab_state, select_tab, and close_tab by focusing on enumeration.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly tells when to use (find tab IDs, see pages, locate website) and implicitly positions it as a prerequisite for tab-specific actions, but does not mention alternatives or when not to use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/BrowserGenie/mcp'

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