browser_close
Close the current browser page in Playwright MCP to manage browser automation sessions and free system resources.
Instructions
Close the page
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "browser_close"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/common.ts:31-35 (handler)Handler implementation for the browser_close tool. Closes the browser context and instructs to include tabs in response with a code snippet 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. No input parameters required, marked as readOnly.
name: 'browser_close', title: 'Close browser', description: 'Close the page', inputSchema: z.object({}), type: 'readOnly', }, - src/tools.ts:17-37 (registration)Imports the common tools module (containing browser_close) and registers it by spreading into the allTools export array used by the MCP server backend.
import common from './tools/common.js'; import console from './tools/console.js'; import dialogs from './tools/dialogs.js'; import evaluate from './tools/evaluate.js'; import files from './tools/files.js'; import install from './tools/install.js'; import keyboard from './tools/keyboard.js'; import navigate from './tools/navigate.js'; import network from './tools/network.js'; import pdf from './tools/pdf.js'; import snapshot from './tools/snapshot.js'; import tabs from './tools/tabs.js'; import screenshot from './tools/screenshot.js'; import wait from './tools/wait.js'; import mouse from './tools/mouse.js'; import type { Tool } from './tools/tool.js'; import type { FullConfig } from './config.js'; export const allTools: Tool<any>[] = [ ...common,