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,
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Close the browser' implies a destructive action that terminates the browser session, but it doesn't specify whether this is reversible, what happens to open tabs/data, or if it requires confirmation. For a potentially destructive tool with zero annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence ('Close the browser') with zero waste. It's front-loaded and directly communicates the core action without unnecessary elaboration. Every word earns its place, making it highly concise and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema, no annotations), the description is minimally complete. It states what the tool does, but for a destructive action like closing a browser, more context on implications (e.g., session loss, irreversibility) would improve completeness. The lack of output schema isn't an issue here, as the action likely has no return value.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100% (since there are no parameters to describe). The description doesn't need to add parameter semantics, so a baseline of 4 is appropriate. No additional value is required or possible beyond stating the tool's purpose.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Close the browser' clearly states the action (close) and target resource (browser). It's specific and unambiguous, though it doesn't differentiate from sibling tools since no other tools perform browser closure. It avoids tautology by not just repeating the tool name 'close'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., after completing tasks), consequences (e.g., losing session state), or when to avoid it (e.g., during active operations). With sibling tools like 'navigate' and 'get_url', some context on usage timing would be helpful.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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