close
Terminate the browser session to free system resources and complete automation tasks efficiently.
Instructions
Close the browser
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- tools-playwright.js:247-259 (registration)Full definition and registration of the 'close' MCP tool object, including name, description, input schema, and handler function within the createPlaywrightTools array.{ name: 'close', description: 'Close the browser', inputSchema: { type: 'object', properties: {}, required: [] }, handler: async () => { await browser.close(); return { success: true, message: 'Browser closed' }; } }
- tools-playwright.js:255-258 (handler)The MCP tool handler function that closes the browser instance and returns a success response.handler: async () => { await browser.close(); return { success: true, message: 'Browser closed' }; }
- tools-playwright.js:250-254 (schema)Input schema definition for the 'close' tool (accepts no parameters).inputSchema: { type: 'object', properties: {}, required: [] },
- browser.js:167-174 (helper)Underlying SimpleBrowser.close() helper method invoked by the tool handler to close the Playwright browser instance.async close() { if (this.browser) { await this.browser.close(); this.browser = null; this.context = null; this.page = null; } }
- tools.js:18-21 (registration)Registration of Playwright tools (including 'close') into the main tools array via spread operator in createTools function.const playwrightTools = createPlaywrightTools(browser); return [ ...playwrightTools,