create_tab
Open a new Firefox tab with isolated session and debugging capabilities, enabling controlled browser automation and advanced multi-tab monitoring.
Instructions
Create a new tab with isolated session and debugging
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contextId | No | ||
| enableMonitoring | No | ||
| tabId | Yes | ||
| url | No | about:blank |
Implementation Reference
- index-multi-debug.js:612-658 (handler)Main handler function for 'create_tab' tool. Creates a new browser context and page (tab), initializes debug buffers, optionally sets up monitoring, navigates to the specified URL, stores the page, and sets it as active if none exists.async createTab(args) { this.ensureBrowserRunning(); const { tabId, url = 'about:blank', contextId, enableMonitoring = true } = args; if (this.pages.has(tabId)) { throw new Error(`Tab with ID '${tabId}' already exists`); } // Create or reuse context const effectiveContextId = contextId || `context-${tabId}`; let context; if (this.contexts.has(effectiveContextId)) { context = this.contexts.get(effectiveContextId); } else { context = await this.browser.newContext({ storageState: undefined // Start with clean state }); this.contexts.set(effectiveContextId, context); } // Create new page in the context const page = await context.newPage(); // Initialize debug buffers this.initDebugBuffers(tabId); // Setup monitoring if enabled if (enableMonitoring) { await this.setupPageMonitoring(page, tabId); } await page.goto(url); this.pages.set(tabId, page); // Set as active tab if no active tab exists if (!this.activeTabId) { this.activeTabId = tabId; } return { content: [{ type: 'text', text: `Tab '${tabId}' created with debugging ${enableMonitoring ? 'enabled' : 'disabled'}. URL: ${url}. Context: ${effectiveContextId}` }] }; }
- index-multi-debug.js:59-70 (schema)Input schema definition for the 'create_tab' tool, specifying parameters tabId (required), url, contextId, enableMonitoring.name: 'create_tab', description: 'Create a new tab with isolated session and debugging', inputSchema: { type: 'object', properties: { tabId: { type: 'string' }, url: { type: 'string', default: 'about:blank' }, contextId: { type: 'string' }, enableMonitoring: { type: 'boolean', default: true } }, required: ['tabId'] }
- index-multi-debug.js:399-400 (registration)Registration/dispatch in the CallToolRequestSchema handler switch statement, calling the createTab method.case 'create_tab': return await this.createTab(args);
- index-multi-debug.js:58-71 (registration)Tool registration object in the ListToolsRequestSchema response tools array.{ name: 'create_tab', description: 'Create a new tab with isolated session and debugging', inputSchema: { type: 'object', properties: { tabId: { type: 'string' }, url: { type: 'string', default: 'about:blank' }, contextId: { type: 'string' }, enableMonitoring: { type: 'boolean', default: true } }, required: ['tabId'] } },