Skip to main content
Glama

Close all agent tabs

browser_close_all_tabs
DestructiveIdempotent

Closes all agent-opened tabs, including those opened by its clicks, and removes the agent's tab group so the user's tab strip is left clean. Released tabs remain with the user.

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, so hand a tab the user should keep to them with browser_release_tab first. 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.7/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description adds real context beyond them: which tabs are closed vs. released, that the tab group is removed, that unsaved state is lost, and that the MCP process performs the same cleanup automatically when the session ends. That last point materially changes an agent's decision about whether and when to call it.

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 sentences, front-loaded with the core action and scope, then the exception, the recommended timing, and the data-loss warning. Nothing is redundant with the title, and each sentence carries a distinct decision-relevant fact.

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?

For a destructive, zero-required-param cleanup tool with no output schema, the description covers the action, scope, exception path, timing, automatic fallback, and data-loss risk. An agent has everything needed to decide whether to call it or use browser_release_tab instead.

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?

The single optional session_id parameter is fully documented in the schema (100% coverage), including isolation semantics and the omit-for-default behavior, so the description adds nothing there. Baseline 3 applies since the schema does all the work and the description only implies scope via "the agent's tabs."

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") plus scope qualifiers: tabs opened by its own clicks are included, and its tab group is removed. It also distinguishes itself from browser_use_tab (taken-over tabs are released, not closed), so an agent can tell it apart from browser_close_tab or browser_release_tab 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 Guidelines5/5

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

Gives explicit when-to-use guidance ("Call this when finished with the browser so no empty group is left in the user's tab strip") and names the alternative path for the exception case ("hand a tab the user should keep to them with browser_release_tab first"). It also notes the automatic invocation at session end, which tells the agent when calling is redundant.

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