new_tab
Open a new browser tab and optionally navigate to a URL. Returns a tab ID for further interaction.
Instructions
Open a brand new browser tab. You can optionally provide a URL to navigate to immediately. Returns the new tab ID so you can interact with it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Optional URL to load in the new tab (e.g., "https://google.com") | |
| apiKey | No | API key for authentication if enabled |
Implementation Reference
- src/tools/tab-management.ts:52-63 (handler)Handler function for the 'new_tab' tool. Sends a 'new_tab' command via WebSocket bridge with an optional URL parameter, and returns the result (new tab ID).
async ({ url, apiKey }) => { const result = await bridge.sendCommand({ command: 'new_tab', params: { url }, apiKey, }); if (!result.success) { return { content: [{ type: 'text', text: `Error: ${result.error?.message}` }], isError: true }; } return { content: [{ type: 'text', text: JSON.stringify(result.data) }] }; } ); - src/tools/tab-management.ts:45-63 (registration)Registration of the 'new_tab' tool using server.tool() from the MCP SDK, with a description and Zod schema for optional 'url' and 'apiKey' parameters.
server.tool( 'new_tab', 'Open a brand new browser tab. You can optionally provide a URL to navigate to immediately. Returns the new tab ID so you can interact with it.', { url: z.string().optional().describe('Optional URL to load in the new tab (e.g., "https://google.com")'), apiKey: z.string().optional().describe('API key for authentication if enabled'), }, async ({ url, apiKey }) => { const result = await bridge.sendCommand({ command: 'new_tab', params: { url }, apiKey, }); if (!result.success) { return { content: [{ type: 'text', text: `Error: ${result.error?.message}` }], isError: true }; } return { content: [{ type: 'text', text: JSON.stringify(result.data) }] }; } ); - src/tools/tab-management.ts:48-51 (schema)Zod schema for the 'new_tab' tool input: optional URL string and optional API key string.
{ url: z.string().optional().describe('Optional URL to load in the new tab (e.g., "https://google.com")'), apiKey: z.string().optional().describe('API key for authentication if enabled'), },