Skip to main content
Glama

set_active_tab

Switch focus to a specific browser tab by specifying its ID using Firefox MCP Server, enabling streamlined automation and multi-tab debugging in Firefox via Playwright.

Instructions

Set active tab

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tabIdYes

Implementation Reference

  • The core handler function for the 'set_active_tab' tool. It validates the tab exists, sets it as the active tab (this.activeTabId = tabId), and returns a success message.
    async setActiveTab(args) {
      const { tabId } = args;
      
      if (!this.pages.has(tabId)) {
        throw new Error(`Tab '${tabId}' not found`);
      }
    
      this.activeTabId = tabId;
      return {
        content: [{ type: 'text', text: `Active tab set to '${tabId}'` }]
      };
    }
  • Registers the 'set_active_tab' tool in the tools list provided to ListToolsRequestSchema, including name, description, and input schema.
    {
      name: 'set_active_tab',
      description: 'Set active tab',
      inputSchema: {
        type: 'object',
        properties: { tabId: { type: 'string' } },
        required: ['tabId']
      }
    },
  • Defines the input schema for the 'set_active_tab' tool, requiring a 'tabId' string.
    inputSchema: {
      type: 'object',
      properties: { tabId: { type: 'string' } },
      required: ['tabId']
  • Dispatches calls to the 'set_active_tab' tool to the setActiveTab method within the central CallToolRequestSchema handler.
    case 'set_active_tab':
      return await this.setActiveTab(args);
Behavior1/5

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

No annotations are provided, so the description must fully disclose behavioral traits. 'Set active tab' implies a mutation operation (changing the active tab), but it fails to describe critical aspects: whether this requires specific permissions, what happens to the previous active tab, if it affects browser focus, error conditions (e.g., invalid tabId), or side effects. The description is too minimal to inform safe or effective use.

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 extremely concise with just three words, front-loading the core action. There is no wasted language or unnecessary elaboration, making it efficient for quick scanning. However, this brevity comes at the cost of completeness, as noted in other dimensions.

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

Completeness1/5

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

Given the tool's complexity (a mutation operation with no annotations, 1 undocumented parameter, and no output schema), the description is severely incomplete. It lacks essential details: purpose differentiation, usage guidelines, behavioral transparency, and parameter semantics. For a tool that likely interacts with browser state, this minimal description is inadequate for safe and effective agent use.

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

Parameters2/5

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

The input schema has 1 parameter (tabId) with 0% description coverage, meaning the schema provides no semantic details. The description does not compensate by explaining what 'tabId' represents (e.g., a browser tab identifier, format, or how to obtain it). This leaves the parameter's meaning and usage unclear, failing to bridge the coverage gap.

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

Purpose2/5

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

The description 'Set active tab' is a tautology that merely restates the tool name without elaboration. It specifies a verb ('Set') and resource ('active tab'), but provides no details about what 'active tab' means, what browser context this applies to, or how it differs from sibling tools like 'create_tab' or 'list_tabs'. This leaves the purpose vague and indistinguishable from alternatives.

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

Usage Guidelines1/5

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

The description offers no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., needing an existing tab), exclusions (e.g., not for creating new tabs), or comparisons to siblings like 'create_tab' or 'navigate'. Without any context, an agent cannot determine appropriate usage scenarios.

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

Related 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/JediLuke/firefox-mcp-server'

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