Skip to main content
Glama

browser_close_all_instances

Close all open browser instances to free system resources and ensure clean browser state for testing or automation workflows.

Instructions

Close all browser instances

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler method in BrowserManager that closes all active browser instances by awaiting the close promises for each browser and clearing the instances map.
    async closeAllInstances(): Promise<ToolResult> {
      try {
        const closePromises = Array.from(this.instances.values()).map(
          instance => instance.browser.close()
        );
        
        await Promise.all(closePromises);
        const closedCount = this.instances.size;
        this.instances.clear();
    
        return {
          success: true,
          data: { closedCount }
        };
      } catch (error) {
        return {
          success: false,
          error: `Failed to close all instances: ${error instanceof Error ? error.message : error}`
        };
      }
    }
  • Dispatch handler in BrowserTools.executeTools() that delegates to BrowserManager.closeAllInstances().
    case 'browser_close_all_instances':
      return await this.browserManager.closeAllInstances();
  • src/tools.ts:83-90 (registration)
    Tool registration in BrowserTools.getTools(), defining the tool name, description, and empty input schema.
    {
      name: 'browser_close_all_instances',
      description: 'Close all browser instances',
      inputSchema: {
        type: 'object',
        properties: {}
      }
    },
  • Input schema definition for the tool (empty object properties).
    inputSchema: {
      type: 'object',
      properties: {}
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the action without behavioral details. It doesn't disclose whether this closes tabs, windows, or processes; whether it's reversible; what happens to unsaved data; or if it requires specific permissions. 'Close all' suggests a destructive operation, but this isn't explicitly stated.

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?

The description is a single, direct sentence with no wasted words. It's front-loaded with the core action and target, making it immediately scannable and efficient. Every word earns its place.

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

Completeness2/5

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

For a destructive tool with no annotations and no output schema, the description is insufficient. It doesn't explain what 'browser instances' means, what gets closed, whether there are confirmation prompts, what the return value is, or error conditions. Given the potential impact, more context is needed.

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?

The tool has 0 parameters with 100% schema description coverage, so no parameter documentation is needed. The description correctly doesn't discuss parameters, maintaining focus on the tool's purpose. Baseline 4 is appropriate for zero-parameter tools.

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 clearly states the action ('Close') and target ('all browser instances'), making the purpose immediately understandable. It distinguishes from sibling 'browser_close_instance' by specifying 'all' instances. However, it doesn't specify what 'browser instances' refers to in this context (e.g., tabs, windows, processes).

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?

No guidance is provided about when to use this tool versus alternatives like 'browser_close_instance' for individual instances or 'browser_list_instances' to check what's open. The description implies a destructive cleanup operation but doesn't specify prerequisites or consequences.

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/sailaoda/concurrent-browser-mcp'

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