Skip to main content
Glama

close

Terminate the browser session to free system resources and complete automation tasks efficiently.

Instructions

Close the browser

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Full definition and registration of the 'close' MCP tool object, including name, description, input schema, and handler function within the createPlaywrightTools array.
    { name: 'close', description: 'Close the browser', inputSchema: { type: 'object', properties: {}, required: [] }, handler: async () => { await browser.close(); return { success: true, message: 'Browser closed' }; } }
  • The MCP tool handler function that closes the browser instance and returns a success response.
    handler: async () => { await browser.close(); return { success: true, message: 'Browser closed' }; }
  • Input schema definition for the 'close' tool (accepts no parameters).
    inputSchema: { type: 'object', properties: {}, required: [] },
  • Underlying SimpleBrowser.close() helper method invoked by the tool handler to close the Playwright browser instance.
    async close() { if (this.browser) { await this.browser.close(); this.browser = null; this.context = null; this.page = null; } }
  • tools.js:18-21 (registration)
    Registration of Playwright tools (including 'close') into the main tools array via spread operator in createTools function.
    const playwrightTools = createPlaywrightTools(browser); return [ ...playwrightTools,

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/zypin-testing/zypin-mcp'

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