close_tab
Close an agent-owned browser tab to clean up background tabs after work is complete. It preserves the foreground tab and refuses to close the active tab unless explicitly allowed.
Instructions
Close an agent-owned browser tab without changing the foreground tab. When to use: clean up background tabs opened by this agent after work is complete. By default, refuses to close the current active foreground tab; pass allow_active:true only when the user explicitly wants the active tab closed. Related: open_tab (create a new tab), list_tabs (find tab IDs), switch_tab (select an agent tab). Multi-agent: agent-scoped tabs; cross-agent reject with TAB_NOT_OWNED; cap configurable (default 8, 1-64). Pass tab_id only when this agent owns multiple tabs; auto-resolves otherwise. RETURNS change_report: when this tool runs, the response includes a change_report field with a compact diff of what the action mutated (URL, dialogs_opened, nodes_added, nodes_removed, attrs_changed, inputs_changed, focus_shift). Use this to learn the consequence without calling read_page next. If the report exceeds the size cap, change_report.truncated:true and change_report_hint are set; call read_page for the full state.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| client | Yes | Allowlisted client label. Validated against the shared v0.9.36 server/extension allowlist (see mcp/src/tools/visual-session.ts -- MCP_VISUAL_CLIENT_LABELS). Required. | |
| tab_id | No | Optional. Tab id to close. Omit when the calling agent owns exactly one tab; required to disambiguate when the agent owns multiple. | |
| is_final | No | When true, the visual session clears immediately after this tool resolves. Optional (default false). | |
| allow_active | No | When true, allow closing the active foreground tab. Default false protects the user-visible active tab. | |
| visual_reason | Yes | Short human-readable reason shown in the overlay (for example, "Logging in to GitHub"). Required. |