close_browser
Close the active browser window to terminate browser automation sessions and free system resources.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.js:91-99 (registration)Registration of the 'close_browser' tool. The inline handler closes the browser instance if it exists, resets the page and CDP session variables, and returns a confirmation message.server.tool("close_browser", {}, async () => { if (browser) { await browser.close(); browser = null; page = null; cdp = null; } return { content: [{ type: "text", text: "Browser closed" }] }; });
- server.js:92-98 (handler)Handler function logic for 'close_browser' tool: checks if browser is open, closes it, nullifies state variables, and responds with success message.if (browser) { await browser.close(); browser = null; page = null; cdp = null; } return { content: [{ type: "text", text: "Browser closed" }] };