Skip to main content
Glama

pilot_tab_select

Switch to a specific browser tab by its ID to continue automation or bring a background tab to the foreground.

Instructions

Switch the active browser context to a specific tab by its ID. Use when the user wants to work in a different tab, bring a background tab to the foreground, or continue automation in a previously opened tab. Use pilot_tabs to find tab IDs.

Parameters:

  • id: The tab ID to switch to (from pilot_tabs output)

Returns: Confirmation with the tab ID that is now active.

Errors:

  • "No such tab": The provided tab ID does not exist. Run pilot_tabs to see valid IDs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesTab ID to switch to

Implementation Reference

  • The handler function for the 'pilot_tab_select' tool. It switches the active browser context to a specific tab by ID. When the Chrome extension is connected, it sends a 'switch_tab' message and calls setExtActiveTab; otherwise, it calls bm.switchTab(id) on the Playwright BrowserManager.
      server.tool(
        'pilot_tab_select',
        `Switch the active browser context to a specific tab by its ID.
    Use when the user wants to work in a different tab, bring a background tab to the foreground, or continue automation in a previously opened tab. Use pilot_tabs to find tab IDs.
    
    Parameters:
    - id: The tab ID to switch to (from pilot_tabs output)
    
    Returns: Confirmation with the tab ID that is now active.
    
    Errors:
    - "No such tab": The provided tab ID does not exist. Run pilot_tabs to see valid IDs.`,
          { id: z.number().describe('Tab ID to switch to') },
        async ({ id }) => {
          await bm.ensureBrowser();
          try {
            const ext = bm.getExtension();
            if (ext) {
              await ext.send('switch_tab', { tabId: id });
              bm.setExtActiveTab(id);
              return { content: [{ type: 'text' as const, text: `Switched to tab ${id}` }] };
            }
            bm.switchTab(id);
            return { content: [{ type: 'text' as const, text: `Switched to tab ${id}` }] };
          } catch (err) {
            return { content: [{ type: 'text' as const, text: wrapError(err) }], isError: true };
          }
        }
      );
  • Schema definition for 'pilot_tab_select': expects a single parameter 'id' (z.number) representing the tab ID to switch to. Includes description, parameter documentation, and error messages.
        'pilot_tab_select',
        `Switch the active browser context to a specific tab by its ID.
    Use when the user wants to work in a different tab, bring a background tab to the foreground, or continue automation in a previously opened tab. Use pilot_tabs to find tab IDs.
    
    Parameters:
    - id: The tab ID to switch to (from pilot_tabs output)
    
    Returns: Confirmation with the tab ID that is now active.
    
    Errors:
    - "No such tab": The provided tab ID does not exist. Run pilot_tabs to see valid IDs.`,
          { id: z.number().describe('Tab ID to switch to') },
  • The tool name 'pilot_tab_select' is listed in the STANDARD_TOOLS set, meaning it is registered as a 'standard' profile tool. It is registered via registerTabTools() in the 'standard' and 'full' tool profiles.
    'pilot_tabs', 'pilot_tab_new', 'pilot_tab_close', 'pilot_tab_select',
  • Helper utility setExtActiveTab(tabId) called by the pilot_tab_select handler to update the active extension tab ID. Also the switchTab(id) method at line 247 that is called when the extension is not connected.
    /** Update the active extension tab (called by pilot_tab_new / pilot_tab_select) */
    setExtActiveTab(tabId: number): void {
      this._extActiveTab = tabId;
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden. It explains that the tool switches the active browser context, returns a confirmation with the tab ID, and lists an error case ('No such tab'). This covers the key behavior, though it could mention that the tab remains open and no data is lost, which is implicit.

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 concise with front-loaded purpose, followed by usage guidance, parameter explanation, returns, and errors. Every sentence adds value and there is no redundancy. It is well-structured for quick parsing.

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

Completeness4/5

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

Given the simplicity of the tool (one parameter, no output schema), the description is largely complete. It covers purpose, usage, parameter, and error handling. However, without an output schema, it could more precisely describe the return format (e.g., a JSON object). The description is adequate but not exhaustive.

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 input schema has 100% coverage with one parameter 'id' described as 'Tab ID to switch to.' The description adds value by specifying that the ID comes from pilot_tabs output, providing context beyond the schema. While the schema already explains the parameter, the description clarifies its source.

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 'Switch the active browser context to a specific tab by its ID.' This is a specific verb+resource, and it distinguishes itself from siblings like pilot_tab_new, pilot_tab_close, and pilot_tabs by focusing on switching to an existing tab.

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?

The description advises using this tool when the user wants to work in a different tab, bring a background tab to the foreground, or continue automation in a previously opened tab. It also explicitly directs to use pilot_tabs to find tab IDs, providing a clear alternative. However, it does not explicitly state when not to use it, which would elevate clarity.

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/TacosyHorchata/Pilot'

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