Skip to main content
Glama

browser.close_tab

Close a specific browser tab by index to manage multiple open tabs during automated browsing sessions.

Instructions

Close one tab index if more than one tab is open.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes
indexYes

Implementation Reference

  • The handler implementation for `browser.close_tab` which delegates the call to the session manager.
    async def _close_tab(self, payload: TabActionInput) -> dict[str, Any]:
        return await self.manager.close_tab(payload.session_id, payload.index)
  • Registration of the `browser.close_tab` tool in the McpToolGateway.
        name="browser.close_tab",
        description="Close one tab index if more than one tab is open.",
        input_model=TabActionInput,
        handler=self._close_tab,
    ),
Behavior2/5

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

No annotations are provided, so the description carries full disclosure burden. It hints at one behavioral trait (the multi-tab requirement) but fails to explain failure modes (error vs silent skip), side effects (which tab becomes active after closing), or whether the operation is reversible. Critical behavioral context is missing.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single efficient sentence with the action front-loaded. The conditional clause at the end is slightly awkward but serves a purpose. No redundant or wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple 2-parameter action tool with no output schema, the description meets minimum viability by identifying the core operation and one key constraint. However, it lacks operational context (error handling, interaction with list_tabs) that would make it fully complete given the zero schema coverage.

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?

With 0% schema description coverage, the description partially compensates by clarifying that the 'index' parameter refers to a 'tab index'. However, it omits explanation of 'session_id' (how to obtain it, format) and lacks details on the indexing scheme (0-based vs 1-based) or valid ranges.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific action ('Close') and resource ('tab index'), distinguishing it from sibling tools like browser.close_session and browser.activate_tab. However, the conditional clause 'if more than one tab is open' is slightly ambiguous—it hints at a behavioral constraint but could be clearer about whether this is a prerequisite or a limitation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

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

The description provides no explicit guidance on when to use this tool versus alternatives (e.g., 'use browser.close_session to close all tabs'), nor does it mention prerequisites like obtaining the index from browser.list_tabs or the inability to close the last remaining tab.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/LvcidPsyche/auto-browser'

If you have feedback or need assistance with the MCP directory API, please join our Discord server