Skip to main content
Glama

CDP: Switch

cdp_switch
Destructive

Set a specific open browser tab as the active CDP target by tab index or URL substring, then keep it fixed for later CDP calls.

Instructions

Make a specific open tab the active target (by tab index or url substring). Sticks on the session so later cdp_* calls act on it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tabNoTab index from cdp_tabs to act on.
urlNoPick the tab whose URL contains this substring.
portNoCDP debug port (default 9222).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Annotations declare destructiveHint=true and readOnlyHint=false, and the description earns credit by disclosing the key trait beyond them: the switch is sticky on the session and affects subsequent calls. It does not explain the port/target lifecycle or why the action is flagged destructive, leaving 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?

Two sentences, zero waste, with the action stated first and the persistence consequence second. Nothing is padded or repeated from the schema.

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 3-param, no-required, no-output-schema tool whose parameters are fully documented, the description covers purpose and persistence semantics adequately. Only the ambiguity of conflicting tab/url inputs and the destructive flag rationale remain unexplained.

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?

Schema description coverage is 100%, so the schema already documents tab, url, and port. The description restates the index/url selection modes but adds no syntax or precedence detail (e.g. what happens if both tab and url are given). Baseline 3 applies.

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+resource: make an open tab the active target, with the two selection modes (tab index or url substring) named. An agent can distinguish it from cdp_tabs (listing) and cdp_targets 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 Guidelines4/5

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

The second sentence gives clear context: it persists on the session so later cdp_* calls act on the chosen target, implying this is a prerequisite/setup step. It does not explicitly name alternatives to exclude, but the ordering guidance is unambiguous.

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

Deploy Server

Other Tools