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")

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