browser_close
Automatically closes web pages after completing accessibility scans to ensure efficient resource management during WCAG compliance testing with MCP Accessibility Scanner.
Instructions
Close the page
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/common.ts:30-34 (handler)The handler function that implements the browser_close tool logic. It closes the browser context via context.closeBrowserContext(), includes tabs in the response, 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:22-28 (schema)Schema definition for the browser_close tool, specifying name, title, description, empty input schema (no parameters), and readOnly type.schema: { name: 'browser_close', title: 'Close browser', description: 'Close the page', inputSchema: z.object({}), type: 'readOnly', },
- src/tools/common.ts:20-35 (registration)Tool definition and registration using defineTool, including capability, schema, and handler. Exported in the module's default array.const close = defineTool({ capability: 'core', schema: { name: 'browser_close', title: 'Close browser', description: 'Close the page', inputSchema: z.object({}), type: 'readOnly', }, handle: async (context, params, response) => { await context.closeBrowserContext(); response.setIncludeTabs(); response.addCode(`await page.close()`); }, });
- src/tools.ts:38-56 (registration)Aggregation of all tools, including those from common.ts (which contains browser_close), into allTools array for use in the backend.export const allTools: Tool<any>[] = [ ...common, ...console, ...dialogs, ...evaluate, ...files, ...form, ...install, ...keyboard, ...navigate, ...network, ...mouse, ...pdf, ...screenshot, ...snapshot, ...tabs, ...wait, ...verify, ];