Skip to main content
Glama

Close browser tab

browser_close_tab
DestructiveIdempotent

Close an open browser tab, discarding any unsaved page state to free up the agent's workspace. Tabs borrowed from the user are released instead of closed.

Instructions

Close one of the agent's tabs, discarding any unsaved page state. A tab taken over with browser_use_tab is released rather than closed — it belongs to the user. Use browser_close_all_tabs to clean up everything at the end of a task.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexNo1-based position within the agent's tabs; fallback mode only, when tab_id is unavailable
tab_idNotab_id of one of the agent's tabs, from browser_open_tab or browser_list_tabs
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. Changed2 schema fields changedv0.3.1
    • changedInput schema / properties / index / description
      Previous value: -"1-based index, fallback mode only"New value: +"1-based position within the agent's tabs; fallback mode only, when tab_id is unavailable"
    • changedInput schema / properties / tab_id / description
      Previous value: -"From browser_list_tabs"New value: +"tab_id of one of the agent's tabs, from browser_open_tab or browser_list_tabs"
  3. First observedv0.3.0

TDQS

A4.4/5.0
Behavior4/5

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

The description adds important behavioral context beyond the annotations: it discloses that closing a tab discards unsaved page state, and that tabs taken over with browser_use_tab are released rather than closed because they belong to the user. The annotations already declare destructiveHint=true and idempotentHint=true, and the description aligns with these. It doesn't contradict the annotations, and it adds meaningful context about the tool's side effects.

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?

The description is three sentences with zero waste. It front-loads the core action and side effect, then provides the sibling distinction and the special case. Every sentence earns its place.

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?

The description is complete for a destructive tab-closing tool. It covers the core behavior, the side effect (discarding unsaved state), the special case for user-owned tabs, and the alternative for bulk cleanup. The only minor gap is that it doesn't explicitly state what happens if both index and tab_id are provided, but the schema's 'fallback mode only' note covers this. With no output schema, the description doesn't need to explain return values.

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 schema description coverage is 100%, so the schema already documents all three parameters (index, tab_id, session_id). The description doesn't add much beyond what the schema provides, but it does clarify the fallback relationship between index and tab_id ('fallback mode only, when tab_id is unavailable'). This is a baseline 3 because the schema carries the heavy lifting.

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?

The description clearly states the tool's function: closing one of the agent's tabs and discarding unsaved page state. It also distinguishes itself from the sibling tool browser_close_all_tabs, which is for cleaning up everything at the end of a task. The verb 'close' and resource 'tab' are specific and unambiguous.

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?

The description explicitly states when to use this tool versus alternatives: use browser_close_all_tabs to clean up everything at the end of a task. It also clarifies the special case of tabs taken over with browser_use_tab, which should be released rather than closed. This is clear, actionable guidance for an agent.

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