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
| Name | Required | Description | Default |
|---|---|---|---|
| tabId | Yes |
Implementation Reference
- index-multi-debug.js:1008-1019 (handler)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}'` }] }; }
- index-multi-debug.js:260-268 (registration)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'] } },
- index-multi-debug.js:263-266 (schema)Defines the input schema for the 'set_active_tab' tool, requiring a 'tabId' string.inputSchema: { type: 'object', properties: { tabId: { type: 'string' } }, required: ['tabId']
- index-multi-debug.js:405-406 (handler)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);