Skip to main content
Glama
andytango
by andytango

list_tabs

Retrieve all open browser tabs with their IDs, URLs, and titles to manage and automate web interactions across multiple pages.

Instructions

List all open browser tabs with their IDs, URLs, and titles

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'list_tabs': calls listTabs() to get all tabs and returns them in a result object.
    async () => {
      const tabs = await listTabs();
      return handleResult(ok({ tabs }));
  • Zod schema defining the input for list_tabs tool (empty object since no parameters required).
    export const listTabsSchema = z.object({});
  • Registers the 'list_tabs' tool with the MCP server, providing name, description, input schema, and handler function.
    server.tool(
      'list_tabs',
      'List all open browser tabs with their IDs, URLs, and titles',
      listTabsSchema.shape,
      async () => {
        const tabs = await listTabs();
        return handleResult(ok({ tabs }));
      }
    );
  • Helper function that implements the core logic for listing all tracked tabs: ensures browser init, fetches URL/title for each page, handles closed pages, indicates active tab.
    export async function listTabs(): Promise<TabInfo[]> {
      await ensureInitialized();
    
      const tabs: TabInfo[] = [];
    
      for (const [id, page] of state.tabs.entries()) {
        try {
          tabs.push({
            id,
            url: page.url(),
            title: await page.title(),
            isActive: id === state.activeTabId,
          });
        } catch {
          // Page may be closed, skip it
          state.tabs.delete(id);
        }
      }
    
      return tabs;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states what the tool returns (IDs, URLs, titles) without disclosing behavioral traits like whether it lists tabs across all windows, if it requires specific permissions, how it handles private/incognito tabs, or what format the output takes. This leaves significant gaps for a tool with zero annotation coverage.

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?

The description is a single, efficient sentence that front-loads the core action ('List all open browser tabs') followed by the return details. Every word earns its place with zero redundancy or unnecessary elaboration.

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

Completeness3/5

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

For a zero-parameter tool with no output schema, the description adequately covers the basic purpose but lacks completeness regarding behavioral context (e.g., scope, permissions, output format). Given the sibling tools involve browser interactions, more context about tab enumeration behavior would be helpful.

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

Parameters4/5

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

The tool has zero parameters with 100% schema description coverage, so the baseline is 4. The description appropriately doesn't waste space discussing non-existent parameters, maintaining focus on the tool's purpose.

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?

The description clearly states the specific action ('List all open browser tabs') and resources involved ('with their IDs, URLs, and titles'). It distinguishes itself from siblings like 'get_content' or 'query_selector' by focusing on tab enumeration rather than content extraction or DOM querying.

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

Usage Guidelines3/5

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

The description implies usage when needing to enumerate tabs, but provides no explicit guidance on when to use this versus alternatives like 'switch_tab' (for navigation) or 'new_tab' (for creation). It lacks explicit when-not-to-use statements or prerequisite context.

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/andytango/puppeteer-mcp'

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