Skip to main content
Glama

Close a tab

browser_close_tab

Close a single Firefox tab by context ID, 0-based index, or active tab without terminating the browser; the response reports remaining tabs and warns if none are left.

Instructions

Close one tab (browsingContext.close). MEASURED: this closes only that tab; the browser keeps running. Pick the tab by context id (from browser_list_tabs), by 0-based index among the tabs of the active window, or default to the active tab. The reply states how many tabs remain, and warns when none are left — at that point Firefox itself may exit.

Input Schema

NameRequiredDescriptionDefault
indexNo0-based index among the active tabs of the active window
activeNoClose the active tab (default when neither context nor index is given)
contextNoBiDi context id of the tab to close (preferred)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With only readOnlyHint=false available, the description carries real weight: it discloses that only the tab closes, that the browser survives, that the reply reports remaining tab count, and that Firefox itself may exit when zero tabs remain. That last point is a genuinely useful non-obvious side effect; return-format detail is the only remaining 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?

Three tight sentences with zero filler; the scoping claim comes first, then target selection, then the reply/warning behavior. Every sentence adds a distinct fact.

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?

No output schema exists, yet the description describes what the reply contains (remaining tab count, warning at zero), which is exactly the missing piece. Precedence between the three optional parameters is the only thing an agent might still want spelled out.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, but the description adds precedence and defaulting semantics ('default to the active tab') and tells the agent where context ids come from. It stops short of elaborating conflict cases such as context supplied together with index.

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 one tab') plus the underlying API call (browsingContext.close). The clause 'this closes only that tab; the browser keeps running' immediately separates it from browser_quit, browser_close_window, and the bulk-close siblings (browser_close_other_tabs, browser_close_tabs_by_url).

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?

Explains exactly how to select the target: context id (sourced from browser_list_tabs), 0-based index in the active window, or default to the active tab. It does not explicitly name when to prefer a bulk-close sibling instead, but the single-tab scoping makes that inference direct.

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