switch_tab
Open a new tab, switch to an existing tab by ID, or close a tab. Manage browser tabs without interfering with the user's active tab.
Instructions
Open a new tab, switch to an existing tab by ID (from virtual_desk), or close a tab. Prefer 'open' over navigate when you don't want to touch the user's active tab. After switching, refs from the previous tab are invalid — call view_page FIRST to get fresh refs before click/type/fill_form. DO NOT try to reuse old refs via evaluate(querySelector) as a shortcut.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | Action: open (new tab), switch (to existing tab, default), close (close tab) | switch |
| url | No | URL to navigate to (for open action, defaults to about:blank) | |
| tab | No | Tab ID or tab number (1-based index, e.g. '2') to switch to or close (defaults to active tab for close) |