Skip to main content
Glama

switch_tab

Switch browser focus to any open tab by its zero-based index to access pages opened in popups or by link targets, returning tab count and page state without re-navigating.

Instructions

Switch the browser focus to a different open tab by its zero-based index. Returns the tab count (plus page_indices, the valid indices, when they are not contiguous) and a page_state object reflecting the switched-to tab's content (headings, landmarks, links). Use to access pages opened by link targets, popups, or forked sub-agents without re-navigating.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexNoZero-based tab index to switch to (0 = first tab). Use the tab count from previous responses to determine valid indices.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.10.0
    • addedInput schema / properties / index / description
      Added value: +"Zero-based tab index to switch to (0 = first tab). Use the tab count from previous responses to determine valid indices."
  2. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It explains the side effect (focus changes), the return value (tab count), the conditional page_indices field, and the page_state object with headings, landmarks, and links. It doesn't describe behavior for an omitted or out-of-range index, which is a small gap.

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 two tight sentences: the first covers the action and return payload, the second covers when to use the tool. There is no filler and no repetition of schema details.

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?

For a single-parameter tool, the description is quite complete: it states the behavior, the return shape, and the intended use cases. The notable omission is behavior when index is omitted or invalid, especially since the schema lists no required parameters.

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

Parameters3/5

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

The schema already describes the index as zero-based and tells the agent to use the tab count from previous responses, giving 100% schema coverage. The description reinforces the index-based switching but adds little beyond what the schema already provides.

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 states the exact action ('Switch the browser focus'), the resource ('a different open tab'), and the selection criterion ('by its zero-based index'). This clearly distinguishes it from navigation siblings like navigate or go_back, which change or move through page history rather than reusing an already-open tab.

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

Usage Guidelines4/5

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

The description gives explicit use cases: 'access pages opened by link targets, popups, or forked sub-agents without re-navigating.' It conveys the right context for choosing this over navigate, though it doesn't explicitly name alternatives or state when not to use it.

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