Skip to content
Kelly Ferrone edited this page Nov 18, 2026 · 1 revision

tab

List the browser's tabs (the default), open one (loading url in it), switch to one (by id; by url, the newest tab whose URL contains that text; or, with neither, the newest), or close one (id, or the current tab).

MCP tool tab
HTTP POST /browser/tab

Every other tool acts on the current tab. A popup a page opens becomes the current tab by itself, and when the current tab closes the session goes back to the tab it came from; a result says so with tab, opened and closed. Only the current tab is in front: Chrome does not render a tab that is not, and Firefox slows its timers.

Parameters

Name Type Required Default
action string no list
id string no —
url string no —

Returns

Field Type Notes
tab string The tab the session is on now (t1, t2, ...).
opened array The tabs that opened, each with its URL. Present only when some did.
closed array The ids of the tabs that closed. Present for close.
in_frame boolean Always false: a tab starts at its top page. Not present for list.
tabs array Every tab, in the order they opened. Present for list.
url string Current URL after the action.
title string Page title after the action.
site_data object Present only when site data was restored, skipped or forgotten in this call.
reopened object Present only on the first result after this workspace's browser was replaced by a new one. What lived only in the old page is gone. Said once.
page object Present only when this browser was opened with capture=true and the page reported a failure while the call ran: what it caused, and where to read it.
flows_here array Present only when this call left the browser on a different page (host, port, path or hash route) and saved flows say they apply there: at most 10, your workspace's own first. Run one with run_flow when its description is the task you were given and you have its required parameters; read its uri first when you are not sure. Being listed here makes a flow fit the page, not your task.

Errors

Status Means
400 The request cannot succeed as sent — a missing field, a value that was rejected, a locator that matched nothing before the wait ran out, or a page whose certificate the browser does not trust. Do not retry it unchanged.
401 Missing or wrong bearer token.
404 No such browser session. It ended, the Grid reaped it, or the id was never real. Open a new one and retry.
409 A person holds this workspace's browser in the live view (call POST /browser/await-control, then retry), or the tab the call was to act on closed before it could act (call again).
413 The body is over its cap: 1 MiB of JSON, 64 MiB of upload, 1 MiB of flow YAML. Send less; retrying it unchanged will fail again.
500 Something failed that this server did not expect.
503 The Grid could not serve this — unreachable, or no free slot for a new browser. Worth retrying after a wait.

Over MCP the same failures arrive as a tool error.

Example

MCP

tab()

HTTP

curl -X POST $SELENIUM_FLOW/browser/tab \
  -H "Authorization: Bearer $TOKEN" \
  -H "Sf-Workspace: $WORKSPACE"

← All actions · Installing · Deployment

Clone this wiki locally