browser_close
Close active web pages in Playwright MCP to end interactions and free up resources, ensuring efficient browser session management.
Instructions
Close the page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/common.ts:31-36 (handler)The handler function that executes the browser_close tool logic: closes the browser context, sets tabs inclusion, and adds code to close the page.handle: async (context, params, response) => { await context.closeBrowserContext(); response.setIncludeTabs(); response.addCode(`await page.close()`); }, });
- src/tools/common.ts:24-29 (schema)Input/output schema definition for the browser_close tool.name: 'browser_close', title: 'Close browser', description: 'Close the page', inputSchema: z.object({}), type: 'readOnly', },
- src/tools.ts:36-52 (registration)Higher-level registration of tools where browser_close (from common.ts) is included via spread operator at line 37.export const allTools: Tool<any>[] = [ ...common, ...console, ...dialogs, ...evaluate, ...files, ...install, ...keyboard, ...navigate, ...network, ...mouse, ...pdf, ...screenshot, ...snapshot, ...tabs, ...wait, ];