manage_tabs
List, open, switch, and close browser tabs. Retrieve tab indexes, URLs, and titles to manage sessions, or open new tabs with optional URLs.
Instructions
Manage browser tabs, including opening new ones.
Use this for listing, opening, switching, or closing tabs.
Use open_url and manage_history for navigation within the active tab.
Args:
action:
- "list_tabs": Return each tab's index, URL, and title.
Use this to find the tab_index for "switch_to_tab".
- "open_new_tab": Open a new tab, optionally navigating to url.
- "switch_to_tab": Switch to the tab at tab_index from "list_tabs".
- "switch_to_newest_tab": Switch to the newest tab.
- "close_active_tab": Close the active tab. This action must be
followed by a 'manage_tabs' action that switches to a new
tab, such as "switch_to_tab" or "switch_to_newest_tab".
url: URL for "open_new_tab". If not provided, "about:blank" is used.
tab_index: Tab index from "list_tabs" that is only used for the
"switch_to_tab" action.)
switch_to: If using "open_new_tab", switch to the new tab when True.Notes: Tab indexes are session-relative and may change after tabs are opened or closed. Use "list_tabs" to get current indexes before switching by index.
Error behavior: If there's an error during any of the tab actions, then @handle_sb_errors will propagate the exception as an error message.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | ||
| action | No | list_tabs | |
| switch_to | No | ||
| tab_index | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |