Skip to main content
Glama

switch_tab

Select an agent-owned browser tab by ID to move between tabs for multi-tab workflows without changing the foreground tab; set active:true only to bring it forward.

Instructions

Select an agent-owned browser tab by tab ID without changing the foreground tab by default. Returns confirmation with the selected tab info. When to use: to move between tabs for multi-tab workflows while keeping the user foreground undisturbed. Pass active:true only when the user explicitly wants this tab foregrounded. Related: list_tabs (get available tab IDs first), open_tab (open a new tab). Multi-agent: agent-scoped tabs; cross-agent reject with TAB_NOT_OWNED; cap configurable (default 8, 1-64). 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

TableJSON Schema
NameRequiredDescriptionDefault
tabIdYesTab ID to select (get IDs from list_tabs tool)
activeNoWhen true, foreground this tab. Default false selects the tab for this agent without stealing focus.
clientYesAllowlisted client label. Validated against the shared v0.9.36 server/extension allowlist (see mcp/src/tools/visual-session.ts -- MCP_VISUAL_CLIENT_LABELS). Required.
is_finalNoWhen true, the visual session clears immediately after this tool resolves. Optional (default false).
visual_reasonYesShort human-readable reason shown in the overlay (for example, "Logging in to GitHub"). Required.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does so: agent-scoped ownership, cross-agent rejection with TAB_NOT_OWNED, a configurable cap (default 8, range 1-64), and a detailed account of the change_report return (fields, truncation flag, and the read_page fallback). This is behavioral context an agent cannot get from the schema alone.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, when-to-use, relations, and return behavior in a logical order, so the reader can stop early. The RETURNS paragraph is somewhat wordy and restates the field list, keeping it short of maximally tight.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, and the description compensates by explaining the change_report return shape, the truncation signal, and the fallback call. Combined with usage routing and multi-agent scoping, an agent has everything needed to invoke and interpret the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description adds real meaning on top by qualifying active ('only when the user explicitly wants this tab foregrounded') and pointing tabId at list_tabs. It does not, however, add anything for client, is_final, or visual_reason beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Select an agent-owned browser tab by tab ID') plus the default behavior (no foreground change), which is the key distinction from navigation tools. It explicitly names related siblings list_tabs and open_tab, so an agent can place it in the tab-management family without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides an explicit 'When to use' clause (multi-tab workflows while keeping user foreground undisturbed) and a clear when-not/exception ('Pass active:true only when the user explicitly wants this tab foregrounded'). It also names prerequisites via the 'Related: list_tabs (get available tab IDs first)' routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.