browser_close
Close the active browser page in Playwright MCP to end browser automation tasks efficiently without additional input or configuration.
Instructions
Close the page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/common.ts:31-38 (handler)The handler function for the browser_close tool. Closes the browser context and returns a code snippet for page.close() without capturing snapshot or waiting for network.handle: async context => { await context.close(); return { code: [`await page.close()`], captureSnapshot: false, waitForNetwork: false, }; },
- src/tools/common.ts:24-29 (schema)Schema definition for the browser_close tool, specifying name, title, description, empty input schema (no parameters), and readOnly type.name: 'browser_close', title: 'Close browser', description: 'Close the page', inputSchema: z.object({}), type: 'readOnly', },
- src/tools/common.ts:20-39 (registration)Registration of the browser_close tool using defineTool, including schema and handler.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:76-77 (registration)The browser_close tool (named 'close') is included in the exported array of core tools.close, resize(captureSnapshot)