browser_close
Close the current browser page to manage resources and end automation sessions. Use this Playwright MCP tool to stop web interactions and clean up browser instances.
Instructions
Close the page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/common.ts:31-38 (handler)Handler for the 'browser_close' tool. Closes the browser context using context.close() and returns specific code snippet and flags for execution.handle: async context => { await context.close(); return { code: [`await page.close()`], captureSnapshot: false, waitForNetwork: false, }; },
- src/tools/common.ts:23-29 (schema)Schema definition for the 'browser_close' tool, including name, title, description, empty input schema, and readOnly type.schema: { name: 'browser_close', title: 'Close browser', description: 'Close the page', inputSchema: z.object({}), type: 'readOnly', },
- src/tools/common.ts:20-39 (registration)Full definition of the 'browser_close' tool using defineTool, which includes schema and handler. This tool object is later exported.const close = defineTool({ capability: 'core', schema: { name: 'browser_close', title: 'Close browser', description: 'Close the page', inputSchema: z.object({}), type: 'readOnly', }, handle: async context => { await context.close(); return { code: [`await page.close()`], captureSnapshot: false, waitForNetwork: false, }; }, });
- src/tools/common.ts:75-78 (registration)Registration of the 'browser_close' tool (as 'close') in the exported array of common tools.export default (captureSnapshot: boolean) => [ close, resize(captureSnapshot) ];