Skip to main content
Glama
Lokii0911
by Lokii0911

browser_stop

Stop the active Selenium browser session to release system resources and terminate automation tasks.

Instructions

Stop the current Selenium browser session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Core handler: BrowserManager.stop() – quits the Selenium WebDriver session under a thread lock, suppresses WebDriverExceptions, sets driver to None, and returns {'stopped': True}.
    def stop(self) -> dict[str, bool]:
        with self._lock:
            if self._driver is not None:
                with suppress(WebDriverException):
                    self._driver.quit()
                self._driver = None
            return {"stopped": True}
  • Registration: The browser_stop tool is registered via @mcp.tool() decorator on a FastMCP instance. The function delegates to browser.stop() through the _run helper.
    @mcp.tool()
    def browser_stop() -> dict[str, bool]:
        """Stop the current Selenium browser session."""
        return _run("browser_stop", browser.stop)
  • Helper: _run() wraps the call to browser.stop(), catches BrowserError and other exceptions, logging them before re-raising.
    def _run(action: str, func: Any, *args: Any, **kwargs: Any) -> Any:
        try:
            return _as_dict(func(*args, **kwargs))
        except BrowserError:
            logger.exception("Browser action failed: %s", action)
            raise
        except Exception as exc:
            logger.exception("Unexpected Selenium MCP error during %s", action)
            raise BrowserError(f"{action} failed: {exc}") from exc
  • Helper (alternate entry): The ASGI route /browser/stop also calls browser.stop() directly via the stop_browser Starlette route handler.
    async def stop_browser(request) -> JSONResponse:  # noqa: ANN001
        return JSONResponse(browser.stop())
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. It only states the action without disclosing side effects, such as whether it closes all windows, clears state, or is idempotent.

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 sentence with no unnecessary words. It is front-loaded and efficient for a simple action.

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

Completeness4/5

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

Given the tool's simplicity (no parameters, straightforward stop action), the description is largely complete. However, it does not mention the output schema or any return value, though that exists.

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?

There are no parameters, so schema coverage is 100%. The description adds no parameter info, but baseline for 0 params is 4, and the description meets it.

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 action 'stop' and the resource 'current Selenium browser session'. It distinguishes from siblings like browser_start and browser_reset, which have different purposes.

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?

No guidance on when to use this tool versus alternatives like browser_reset or closing windows. The description does not mention prerequisites or typical usage scenarios.

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/Lokii0911/SeleniumMCP'

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