Skip to main content
Glama

close_browser

Close the active Chromium browser instance to free system resources and complete automation sessions on ARM64 devices.

Instructions

Close the browser instance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'close_browser' tool. Closes the WebSocket connection to Chromium, terminates the Chromium process gracefully (with timeout fallback to SIGKILL), resets state variables, and returns a success message.
    async closeBrowser() {
      if (wsConnection) {
        wsConnection.close();
        wsConnection = null;
      }
      
      if (chromiumProcess && chromiumProcess.exitCode === null) {
        chromiumProcess.kill('SIGTERM');
        
        // Wait for graceful shutdown
        await new Promise(resolve => {
          chromiumProcess.on('exit', resolve);
          setTimeout(() => {
            chromiumProcess.kill('SIGKILL');
            resolve();
          }, 5000);
        });
        
        chromiumProcess = null;
      }
      
      currentTabId = null;
      
      return {
        content: [{ type: 'text', text: 'Browser closed successfully' }],
      };
    }
  • index.js:336-342 (registration)
    Registration of the 'close_browser' tool in the tools list provided to MCP's handleToolsListRequest, including empty input schema.
      name: 'close_browser',
      description: 'Close the browser instance',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Handler function for 'close_browser' in the browser-only variant of the MCP server. Similar to main implementation but simpler process termination.
    async closeBrowser() {
      if (wsConnection) {
        wsConnection.close();
        wsConnection = null;
      }
      
      if (chromiumProcess) {
        chromiumProcess.kill('SIGTERM');
        chromiumProcess = null;
      }
      
      currentTabId = null;
      
      return {
        content: [{ type: 'text', text: 'Browser closed successfully' }],
      };
    }
  • Registration of the 'close_browser' tool in the browser-only server's tools list.
      name: 'close_browser',
      description: 'Close the browser instance',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • Python wrapper/client handler that calls the MCP server for 'close_browser' tool.
    def close_browser(self) -> str:
        """Close the browser instance."""
        result = self._call_mcp_server("close_browser", {})
        if "error" in result:
            return f"Error: {result['error']}"
        
        content = result.get("content", [{}])
        return content[0].get("text", "Browser closed")
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Close the browser instance' implies a destructive action that terminates the session, but it doesn't specify consequences (e.g., loss of unsaved data, effect on subsequent operations) or requirements (e.g., permissions, state dependencies). For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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, clear sentence with zero wasted words. It's front-loaded with the core action and target, making it highly efficient and easy to parse. Every word earns its place by directly conveying the tool's function.

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?

Given the tool's complexity (a destructive operation with no parameters) and lack of annotations or output schema, the description is incomplete. It doesn't address behavioral aspects like what 'close' entails (e.g., graceful shutdown vs. force quit), return values, or error conditions. For a mutation tool in a browser automation context, more detail is needed to guide safe usage.

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, and schema description coverage is 100%, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, which aligns with the empty input schema. A baseline of 4 is applied since there are no parameters to explain.

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 browser instance'), which is specific and unambiguous. However, it doesn't differentiate from siblings like 'navigate' or 'wipe_logs' that also affect browser state, so it doesn't fully distinguish its unique purpose among related tools.

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. It doesn't mention prerequisites (e.g., after completing tasks), exclusions (e.g., not during active debugging), or sibling tools that might be relevant (like 'navigate' for changing pages instead of closing). This leaves usage context entirely implicit.

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/nfodor/claude-arm64-browser'

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