Skip to main content
Glama

Close every tab showing a URL

browser_close_tabs_by_url

Close all tabs whose URL contains the specified text via substring matching, so you can clean up after batch runs without touching unrelated tabs.

Instructions

Close all tabs whose URL contains the given text. MEASURED: gBrowser.closeTabsByURI takes nsIURI objects and matches them EXACTLY, so it cannot do substrings — this walks the tabs and calls removeTab instead. The value is matched as a substring against the tab URL, so "example.com" catches all of that site. Useful to clean up after a batch run without touching unrelated tabs.

Input Schema

NameRequiredDescriptionDefault
patternYesText or regex matched against tab URLs

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With only readOnlyHint=false available, the description adds meaningful behavioral context by explaining substring matching and noting that the implementation walks tabs and calls removeTab. It does not cover edge cases like pinned tabs or undo behavior, but it is substantially more informative than the annotation alone.

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 first sentence front-loads the core action, and the remaining sentences provide relevant matching and usage context. It is appropriately sized, though the internal gBrowser API detail is slightly heavier than necessary for tool selection.

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-parameter destructive tool with no output schema, the description covers what it does, how matching works, and a primary use case. Minor gaps remain around pinned tabs, grouped tabs, and no-match behavior, but the essential information is present.

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 the baseline is 3, but the description adds important meaning: the pattern is matched as a substring, not as an exact URI or necessarily as a regex. The 'example.com' example clarifies the matching behavior well, despite a mild tension with the schema's 'text or regex' wording.

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 verb and resource: closing all tabs whose URL contains the given text. It distinguishes itself by matching URL substrings rather than closing a single tab, though it does not explicitly name sibling tools like browser_close_tab or browser_close_other_tabs.

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?

It gives a clear use case: cleaning up after a batch run without affecting unrelated tabs. It does not explicitly state when not to use it versus browser_close_tab or browser_close_other_tabs, but the context is strong enough.

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