Skip to main content
Glama

close_browser

Automatically close the Firefox browser and all active tabs using the MCP Server, ensuring clean termination of browser sessions for controlled automation workflows.

Instructions

Close browser and all tabs

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler function for the 'close_browser' tool. It closes the Playwright Firefox browser instance, clears all associated contexts, pages, active tabs, and debug monitoring buffers (console logs, JS errors, network activity, etc.), and returns a text confirmation message.
    async closeBrowser() { 
      if (this.browser) {
        await this.browser.close();
        this.browser = null;
        this.contexts.clear();
        this.pages.clear();
        this.activeTabId = null;
        
        // Clear all debug buffers
        this.consoleLogs.clear();
        this.jsErrors.clear();
        this.networkActivity.clear();
        this.wsMessages.clear();
        this.performanceMetrics.clear();
      }
      
      return {
        content: [{ type: 'text', text: 'Firefox browser closed, all tabs and debug buffers cleared' }]
      };
    }
  • Registration/dispatch in the CallToolRequestSchema handler's switch statement, which maps incoming 'close_browser' tool calls to the closeBrowser() method.
    case 'close_browser':
      return await this.closeBrowser();
  • Input schema definition for the 'close_browser' tool in the ListToolsRequestSchema response. Defines the tool with no required input parameters.
    {
      name: 'close_browser',
      description: 'Close browser and all tabs',
      inputSchema: { type: 'object', properties: {} }
    },
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. While 'Close browser and all tabs' implies a destructive action that terminates sessions, it lacks details on effects (e.g., loss of unsaved data, cleanup of resources, error handling). For a tool with no annotations, this leaves significant behavioral gaps.

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 with zero waste—'Close browser and all tabs' is front-loaded and directly conveys the core action. 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 complexity (simple destructive action), no annotations, no output schema, and 0 parameters, the description is minimally adequate. It states what the tool does but lacks context on outcomes, side effects, or error conditions, leaving room for improvement in completeness.

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 does not need to add parameter semantics, so it meets the baseline expectation for a parameterless tool, though it does not explicitly state 'no parameters required'.

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 'Close browser and all tabs' clearly states the specific action (close) and target resources (browser, all tabs). It distinguishes from sibling tools like 'close_tab' (which closes a single tab) and 'create_tab' (which creates rather than closes), making the scope and differentiation explicit.

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 does not mention prerequisites (e.g., whether a browser must be open), exclusions (e.g., avoid if unsaved work exists), or comparisons to siblings like 'close_tab' for partial closure. Usage is implied but not explicitly stated.

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/JediLuke/firefox-mcp-server'

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