Skip to main content
Glama
xav-ie

Browser Session MCP

switch_tab

Idempotent

Makes the tab at a given index the active tab so subsequent navigate, evaluate, screenshot, click, and type calls target it, and brings it to the front in Chrome.

Instructions

Make the tab at tabIndex the active tab, so later navigate/evaluate/screenshot/click/type calls target it, and bring it to the front in Chrome (the human-takeover live view follows it too). Use new_page to open a tab instead, and pass tabIndex straight to evaluate or the profiling tools to act on another tab without switching. Indices come from list_pages and shift when a tab closes, so list again if unsure. Fails if the session has no tab at that index.

Input Schema

NameRequiredDescriptionDefault
tabIndexYesA tab's 0-based index from list_pages. Errors if the session has no tab at that index.
sessionIdYesThe id returned by open_browser_session. Errors if no open session has it.

Output Schema

NameRequiredDescriptionDefault
urlYes
indexYesThe tab's 0-based list_pages index.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.1.5
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "properties": {
      +    "index": {
      +      "description": "The tab's 0-based list_pages index.",
      +      "format": "uint",
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "url": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "index",
      +    "url"
      +  ],
      +  "type": "object"
      +}
  2. Changed2 schema fields changed
    • addedInput schema / properties / sessionId / description
      Added value: +"The id returned by open_browser_session. Errors if no open session has it."
    • addedInput schema / properties / tabIndex / description
      Added value: +"A tab's 0-based index from list_pages. Errors if the session has no tab at that index."
  3. First observedv0.1.2

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations, the description explains that switching affects later navigate/evaluate/screenshot/click/type calls, brings the tab to the front in Chrome, and moves the human-takeover live view with it. It also discloses that indices shift when tabs close and that failure occurs if no tab exists at that index.

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 front-loaded with the primary action and consequence, then adds alternatives, index volatility, and failure behavior in tight sentences. Every sentence earns its place.

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?

Given the annotations, full schema coverage, and available output schema, the description supplies the remaining behavior an agent needs: targeting effects, tab-to-front behavior, index volatility, alternatives, and failure condition. Nothing important for correct invocation is missing.

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, but the description adds useful semantic context about tabIndex: it comes from list_pages, shifts when a tab closes, and should be refreshed if uncertain. It also explains an alternative use of tabIndex with evaluate/profiling tools without switching.

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 uses a specific verb and resource: it makes the tab at tabIndex the active tab. It also distinguishes this from new_page and from acting on another tab via evaluate/profiling without switching.

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?

It explicitly says to use new_page to open a tab and to pass tabIndex directly to evaluate or profiling tools when switching is unnecessary. It also gives practical guidance to re-list pages if indices may have shifted and states the failure condition.

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