Skip to main content
Glama

tab_close

Close a specified or current browser tab and discard its page state while keeping the browser running; returns the ID of the tab active afterwards.

Instructions

Close one tab and discard its page state; the browser itself keeps running. Defaults to the current tab; pass tab to close another. Returns the id of the tab that is current afterwards. To shut down the whole browser use browser_close. Element refs from the closed tab are gone.

Input Schema

NameRequiredDescriptionDefault
tabNoTab id from tabs_list. Defaults to the current tab.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the annotations (readOnlyHint=false, openWorldHint=true) by naming exactly what is destroyed — the tab's page state and any element refs from it — and by stating the post-condition that the browser keeps running. It also pre-announces the return value (the id of the tab that is current afterwards), which is important for an agent that must re-anchor after a destructive close.

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 short sentences, front-loaded with the action and scope, then default/override, then the sibling escape hatch and the invalidation warning. No filler and nothing repeated.

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?

For a one-optional-param mutation with no output schema, the description covers destruction, scope, default, alternative, and return value — nearly everything needed. The only gap is unspecified failure behavior when `tab` is unknown or already closed.

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 coverage is 100% and the single parameter already documents its source ('Tab id from tabs_list') and its default, so the description only restates the default. Baseline 3 is appropriate since the schema carries the semantic load.

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 scope boundary ('the browser itself keeps running'), which immediately separates it from browser_close and tab_new/tab_select. An agent can pick it 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 the default behavior (closes the current tab), the override ('pass `tab` to close another'), and an explicit pointer to the alternative for a different intent ('To shut down the whole browser use browser_close'). The when-to-use and when-to-use-something-else conditions are both present.

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