Skip to main content
Glama

browser_close_tab

Close a specific browser tab by ID within the current session, returning whether it closed or stayed open due to a prompt or busy page.

Instructions

Close a browser tab by ID. Only tabs owned by the current session can be closed. If it is the last tab in Chrome's last window, an empty tab is left in that window (kept_window_open: true), because closing the window would close Chrome and disconnect the extension. If Chrome does not close the tab within 4 s (a "Leave site?" prompt or a busy page), the answer is tab-not-closed and the tab stays in the session.

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": {
      "tab_id": "<tab_id>"
    },
    "name": "browser_close_tab"
  }
}

Input Schema

NameRequiredDescriptionDefault
tab_idYesTab ID to close (get from browser_list_tabs)
partitionNoRun this call in a partition from browser_partition (an id like "p1"). Leave it out for the default partition. An unknown or closed id is an error; the call is never sent to the default partition instead.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.33.0
    • addedInput schema / properties / partition
      Added value: +{
      +  "description": "Run this call in a partition from browser_partition (an id like \"p1\"). Leave it out for the default partition. An unknown or closed id is an error; the call is never sent to the default partition instead.",
      +  "type": "string"
      +}
  2. First observedv1.0.0

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does it well: it discloses the last-window edge case (an empty tab is deliberately left, kept_window_open: true) and explains WHY, plus the 4 s timeout, the tab-not-closed outcome, and the "Leave site?" prompt trigger. These are non-obvious behaviors an agent could not infer from the schema.

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?

Front-loads the purpose, then layers constraints and failure modes in a logical order with no filler. It is dense but every sentence carries information; the parenthetical aside explaining the Chrome-disconnect rationale is the only slightly verbose element.

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?

There is no output schema, so the description must convey return outcomes — and it does, naming the kept_window_open: true field and the tab-not-closed result. Combined with the timeout and session-ownership constraints, nothing an agent needs to call this correctly is missing.

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 both tab_id and partition are already documented, including the partition error behavior and the browser_list_tabs source. The description adds no parameter-level meaning beyond the schema, so the 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 and resource ("Close a browser tab by ID") with an explicit scoping qualifier ("Only tabs owned by the current session"). This is easily separable from siblings like browser_switch_tab, browser_get_new_tab, and browser_list_tabs without opening the 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?

Gives clear context for use: the tab must belong to the current session, and the ID comes from browser_list_tabs (via the schema). It does not explicitly route an agent to an alternative when a tab is not session-owned, leaving the fallback path implied rather than named.

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