Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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, }; },
  • 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', },
  • 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, }; }, });
  • The browser_close tool (named 'close') is included in the exported array of core tools.
    close, resize(captureSnapshot)

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Angeluis001/playwright-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server