Skip to main content
Glama

close_browser

Terminate the current browser instance in MCP Browser Server to manage resources effectively and end automated web interactions.

Instructions

Close the current browser instance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler case for 'close_browser' tool that closes the current browser instance if it exists, nullifies the global browser/context/page variables, and returns an appropriate success or informational message.
    case 'close_browser': {
      if (currentBrowser) {
        await currentBrowser.close();
        currentBrowser = null;
        currentContext = null;
        currentPage = null;
    
        return {
          content: [
            {
              type: 'text',
              text: 'Browser closed successfully'
            }
          ]
        };
      } else {
        return {
          content: [
            {
              type: 'text',
              text: 'No browser instance to close'
            }
          ]
        };
      }
    }
  • src/index.ts:323-329 (registration)
    Registration of the 'close_browser' tool in the ListTools response, including its name, description, and empty input schema (no parameters required).
      name: 'close_browser',
      description: 'Close the current browser instance',
      inputSchema: {
        type: 'object',
        properties: {}
      }
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'Close' implies a destructive action, it doesn't specify consequences like whether all tabs/sessions are terminated, if data is lost, or what happens after closure. More behavioral context would be helpful for a mutation tool.

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, perfectly focused sentence with zero wasted words. It's front-loaded with the core action and resource, making it immediately understandable without any structural issues.

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?

For a zero-parameter mutation tool with no annotations and no output schema, the description adequately states what the tool does but lacks important behavioral context about consequences and post-closure state. It's minimally viable but leaves gaps in understanding the tool's full impact.

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 with 100% schema description coverage, so the schema already fully documents the lack of inputs. The description appropriately doesn't add parameter information, maintaining focus on the tool's purpose without unnecessary details.

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

Purpose5/5

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

The description clearly states the specific action ('Close') and target resource ('the current browser instance'), distinguishing it from sibling tools like 'launch_browser' which performs the opposite operation. It precisely communicates what the tool does without ambiguity.

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

Usage Guidelines4/5

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

The description implies usage context by specifying 'current browser instance', suggesting it should be used when a browser is already open. However, it doesn't explicitly state when NOT to use it (e.g., when no browser is active) or mention alternatives like 'launch_browser' for starting a browser.

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

Related 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/Wladastic/mcp-browser-server'

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