Skip to main content
Glama

browser_close_instance

Close a specific browser instance to manage resources and end sessions in the Concurrent Browser MCP server.

Instructions

Close the specified browser instance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instanceIdYesInstance ID

Implementation Reference

  • Handler case in executeTools method that handles the browser_close_instance tool by calling BrowserManager.closeInstance
    case 'browser_close_instance':
      return await this.browserManager.closeInstance(args.instanceId);
  • src/tools.ts:69-82 (registration)
    Tool registration in getTools() method, defining name, description, and input schema
    {
      name: 'browser_close_instance',
      description: 'Close the specified browser instance',
      inputSchema: {
        type: 'object',
        properties: {
          instanceId: {
            type: 'string',
            description: 'Instance ID'
          }
        },
        required: ['instanceId']
      }
    },
  • Core implementation in BrowserManager that closes the Playwright browser instance and removes it from the instances map
    async closeInstance(instanceId: string): Promise<ToolResult> {
      try {
        const instance = this.instances.get(instanceId);
        if (!instance) {
          return {
            success: false,
            error: `Instance ${instanceId} not found`
          };
        }
    
        await instance.browser.close();
        this.instances.delete(instanceId);
    
        return {
          success: true,
          data: { instanceId, closed: true },
          instanceId
        };
      } catch (error) {
        return {
          success: false,
          error: `Failed to close instance: ${error instanceof Error ? error.message : error}`
        };
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('Close') but doesn't explain what closing entails (e.g., whether it terminates processes, frees resources, or if it's reversible). It also omits potential side effects, error conditions, or permissions needed, which is a significant gap for a mutation tool.

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 zero wasted words. It front-loads the core action and target, making it immediately scannable and efficient. Every word earns its place, and there's no unnecessary elaboration or redundancy.

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 mutation tool with no annotations and no output schema, the description is incomplete. It doesn't cover what happens after closing (e.g., success/failure indicators, cleanup effects) or how it integrates with sibling tools (e.g., 'browser_list_instances'). The agent lacks context on behavioral outcomes and error handling, which is critical for safe operation.

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?

The schema description coverage is 100%, with the single parameter 'instanceId' documented as 'Instance ID'. The description adds no additional meaning beyond this, such as how to obtain the ID or format requirements. Given the high schema coverage, a baseline score of 3 is appropriate as the schema handles the parameter documentation adequately.

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 ('the specified browser instance'), making the purpose immediately understandable. It distinguishes from siblings like 'browser_close_all_instances' by specifying a single instance, though it doesn't explicitly name this distinction. The description avoids tautology by not just restating the tool name.

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 guidance on when to use this tool versus alternatives like 'browser_close_all_instances' or 'browser_list_instances'. It doesn't mention prerequisites (e.g., needing an existing instance) or typical workflows (e.g., cleanup after operations). This leaves the agent to infer usage from context alone.

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