Skip to main content
Glama

ui_tabs

ui_tabs

List, switch, and close browser tabs in a Playwright automation session to control which tab tools act on and manage link-opened tabs.

Instructions

Manage browser tabs of this session (numbered from 1). A link with target=_blank or window.open opens a new tab, announced on the next tool response but not switched to. list: index, url, title, current. switch: make that tab the one every tool acts on. close: close that tab (default: the current one) and fall back to the previous one; the last tab cannot be closed.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "action": "<action>"
    },
    "name": "ui_tabs"
  }
}

Input Schema

NameRequiredDescriptionDefault
indexNoTab number from `list` (required for switch)
actionYeslist, switch or close
session_idNoWhich open session to act on, as returned by ui_start_session. Optional with one open session; required when several are open.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations present, the description carries the full burden and does so well: tabs are numbered from 1, new tabs from links are announced on the next response but not activated, close falls back to the previous tab, and the last tab cannot be closed. These are real consequences an agent needs before mutating state. It omits error behavior beyond the last-tab constraint and says nothing about what switching does to in-flight page state.

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?

It is dense and front-loaded: the scope and numbering convention come first, then one clause per action with colon-delimited labels. Every clause carries information, though the semicolon-chained phrasing makes it slightly harder to scan than a short bulleted structure would be. Nothing is wasted.

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 three-parameter tool with no annotations and no output schema, the description covers the action set, index semantics, the default for close, and the fields `list` returns (index, url, title, current). The only real gap is error/recovery behavior beyond the last-tab rule, which is minor given the tool's simplicity.

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 meaning beyond the schema by explaining that index values come from `list` and are numbered from 1, and by specifying that close defaults to the current tab when no index is given – a default the schema itself does not state. That is genuine added value over a fully documented schema.

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

Purpose4/5

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

The description states a specific verb (manage) and resource (browser tabs) scoped to 'this session', and enumerates the three actions, so an agent knows this is the tab-management tool rather than a page-interaction sibling. It stops short of naming a sibling tool it contrasts with, which is the only thing separating it from a 5.

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?

Each action is given a concrete condition for use: 'switch: make that tab the one every tool acts on' and 'close: ... default: the current one'. The note that target=_blank/window.open creates a tab that is announced but not switched to tells the agent when it must call switch. No explicit 'do not use this when...' exclusion is offered, so it is clear context without full routing guidance.

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