Skip to main content
Glama

close_tab

Close a browser tab by index, browser-derived ID, or name substring; use -1 for the active tab or -99 for the last. This targets the intended tab in automation sessions.

Instructions

Close tab by index, browser-derived id, or name substring (-1 active, -99 last). Accepts 'tab'/'index'.

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": "close_tab"
  }
}

Input Schema

NameRequiredDescriptionDefault
tabNo
indexNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

B3.2/5.0
Behavior2/5

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

With no annotations supplied, the description carries the full behavioral burden and only partly meets it. It usefully discloses the magic sentinels (-1 active, -99 last), but says nothing about side effects of closing (lost state), what happens when no tab matches, or whether closing the active tab changes focus.

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?

Two short sentences that front-load the primary action and the identifier modes, with the sentinel values parenthesized efficiently. The trailing note about accepted argument names is terse to the point of slight ambiguity but is not wasted text.

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?

Return values need not be covered because an output schema exists, and only two optional parameters exist. Still, for a destructive-feeling action with zero annotations, an agent is left without guidance on match failure or the precedence of tab vs index, which is a meaningful gap.

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 description coverage is 0%, so the description must compensate and it does add real meaning: 'tab' accepts an integer index, a browser-derived id, or a name substring, plus the -1/-99 sentinels. However, it never explains the relationship between the separate 'tab' and 'index' parameters or what happens when both are omitted (both default to null).

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?

States a specific verb and resource ('Close tab') and immediately enumerates the accepted identifiers (index, browser-derived id, name substring), which clearly separates it from close_browser. It stops short of naming the sibling it differs from, but the scope of what it closes is unambiguous.

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

Usage Guidelines3/5

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

Usage is only implied by the verb 'close' and the identifier options; there is no explicit statement of when to prefer this over close_browser or switch_tab. An agent can infer the context, but nothing in the text rules out misuse or states prerequisites.

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