Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
actionNoAction: open (new tab), switch (to existing tab, default), close (close tab)switch
urlNoURL to navigate to (for open action, defaults to about:blank)
tabNoTab ID or tab number (1-based index, e.g. '2') to switch to or close (defaults to active tab for close)
Behavior4/5

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

No annotations are provided, so the description must bear the full burden. It discloses that refs become invalid after switching and advises against using evaluate as a shortcut. However, it does not mention potential side effects like closing a tab's resources or authentication requirements.

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

Conciseness5/5

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

The description is concise (two sentences plus a warning), front-loaded with purpose, then usage guidelines, then important behavioral notes. No redundant information.

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

Completeness4/5

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

Given no output schema and moderate complexity, the description covers purpose, usage, and cross-tab behavior. It mentions sibling tool 'navigate' for differentiation. It does not explicitly state the default for close action (active tab), though the schema does.

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?

The schema already covers all parameters with descriptions (100% coverage). The description adds useful context: tab IDs come from virtual_desk, and actions have defaults. This adds value beyond the schema but does not introduce new parameter details.

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?

The description clearly states the three actions (open, switch, close) and the specific resource (tabs). It distinguishes from the sibling tool 'navigate' by advising preference for 'open' when not wanting to affect the user's active tab.

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?

The description provides explicit when-to-use guidance: prefer 'open' over 'navigate' to avoid touching the active tab. It also instructs to call view_page after switching to get fresh refs, and warns against reusing old refs via evaluate.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Silbercue/public-browser'

If you have feedback or need assistance with the MCP directory API, please join our Discord server