Skip to main content
Glama
Lokii0911
by Lokii0911

open_new_tab

Open a new browser tab and optionally navigate to a specified URL to manage multiple pages or separate tasks during automation.

Instructions

Open a new browser tab and optionally navigate it to a URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'open_new_tab' - decorated with @mcp.tool(), delegates to browser.open_new_tab via _run helper.
    @mcp.tool()
    def open_new_tab(url: str | None = None) -> dict[str, Any]:
        """Open a new browser tab and optionally navigate it to a URL."""
        return _run("open_new_tab", browser.open_new_tab, url)
  • _run helper function that invokes the browser method with error handling and dict conversion.
    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
  • Core implementation of open_new_tab on BrowserManager - validates URL, switches to a new tab window, optionally navigates to URL, returns BrowserState.
    def open_new_tab(self, url: str | None = None) -> BrowserState:
        if url is not None:
            self._validate_url(url)
        with self._lock:
            driver = self._require_driver()
            driver.switch_to.new_window("tab")
            if url is not None:
                driver.get(url)
            return self.state()
  • BrowserState Pydantic model - the return type schema for open_new_tab.
    class BrowserState(BaseModel):
        session_id: str | None
        current_url: str | None
        title: str | None
        window_handles: list[str]
        active_window_handle: str | None
Behavior2/5

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

With no annotations, the description carries full burden but only states basic functionality. It does not disclose whether the tab is focused, whether a handle is returned, or any error conditions (e.g., tab limits).

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?

A single, concise sentence that is front-loaded with the main action. No unnecessary words.

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?

The tool is simple (one optional parameter), but the description omits the return value (output schema exists but not described). Adequate for basic understanding but not fully complete.

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

Parameters3/5

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

The description adds meaning to the 'url' parameter by stating it is for optional navigation, but does not explain required format or behavior when null. Given 0% schema coverage, more detail would be beneficial.

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 verb 'Open' and the resource 'new browser tab', and distinguishes from sibling tools like 'navigate' which operates on the current tab. The optional URL navigation is also specified.

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 vs alternatives like 'navigate' or 'click'. No mention of prerequisites (e.g., browser must be started) or when not to use it.

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