Skip to main content
Glama

Close all agent tabs

browser_close_all_tabs
DestructiveIdempotent

Close every tab the agent opened, including those opened by its clicks, and remove its tab group when done. Tabs taken over with browser_use_tab are released, not closed; unsaved state is lost.

Instructions

Close every tab the agent opened, including tabs its clicks opened, and remove its tab group. Tabs taken over with browser_use_tab are released back to the user, not closed. Call this when finished with the browser so no empty group is left in the user's tab strip. The MCP process also runs this automatically when the Computer Use session ends. Unsaved state in the agent's tabs is lost.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "browser_close_all_tabs"
  }
}

Input Schema

NameRequiredDescriptionDefault
session_idNoStable task or thread ID. Pass the same value on every browser call for this task. Different IDs isolate tabs and cleanup within one MCP process. Omit for the default process session.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.4.3
    • addedInput schema / properties / session_id
      Added value: +{
      +  "description": "Stable task or thread ID. Pass the same value on every browser call for this task. Different IDs isolate tabs and cleanup within one MCP process. Omit for the default process session.",
      +  "maxLength": 128,
      +  "minLength": 1,
      +  "type": "string"
      +}
  2. First observedv0.3.0

TDQS

A4.5/5.0
Behavior5/5

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

Goes well beyond the annotations (destructiveHint/idempotentHint): it discloses what is destroyed ('Unsaved state in the agent's tabs is lost'), that taken-over tabs are released rather than closed, and that the MCP process runs the same cleanup automatically at Computer Use session end. That last point materially affects whether the agent should call it at all.

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?

Four short sentences, front-loaded with the action and each carrying distinct information: scope, the use_tab exception, the recommended call timing, the automatic behavior, and the data-loss warning. No filler.

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?

With no output schema and a single schema-documented parameter, the description covers everything an agent needs: what is closed, what is not, when to call it, what is lost, and that cleanup may happen automatically. Nothing material 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 session_id is fully documented in the schema; the description adds nothing about the parameter (e.g. how session scoping interacts with the auto-cleanup at session end). Baseline 3 applies when the schema carries the parameter burden alone.

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 every tab the agent opened') and precisely bounds scope: agent-opened tabs including those opened by clicks, plus removal of the tab group. This is clearly distinguishable from the single-tab sibling browser_close_tab and from browser_release_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?

Gives an explicit trigger ('Call this when finished with the browser') and explains the consequence of not calling it (leftover empty group in the user's tab strip). It also notes the agent does not need to close tabs it merely took over with browser_use_tab, but it never names browser_close_tab as the alternative for closing a single tab.

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