Skip to main content
Glama
Lokii0911
by Lokii0911

navigate

Navigate the browser to specified HTTP, HTTPS, or allowed file URLs using Selenium for controlled web interactions.

Instructions

Navigate the browser to an http, https, or allowed file URL.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler that executes the navigate tool logic. It validates the URL, calls Selenium's driver.get(url), and returns the BrowserState.
    def navigate(self, url: str) -> BrowserState:
        self._validate_url(url)
        with self._lock:
            driver = self._require_driver()
            try:
                driver.get(url)
            except TimeoutException as exc:
                raise BrowserError(f"Timed out loading {url}") from exc
            return self.state()
  • The MCP tool registration for 'navigate'. Decorated with @mcp.tool(), it delegates to browser.navigate via the _run helper.
    @mcp.tool()
    def navigate(url: str) -> dict[str, Any]:
        """Navigate the browser to an http, https, or allowed file URL."""
        return _run("navigate", browser.navigate, url)
  • URL validation helper called by navigate(). Checks that the URL scheme is http, https, or optionally file, and that http/https URLs have a hostname.
    def _validate_url(self, url: str) -> None:
        parsed = urlparse(url)
        allowed_schemes = {"http", "https"}
        if self._settings.allow_file_urls:
            allowed_schemes.add("file")
        if parsed.scheme not in allowed_schemes:
            raise BrowserError(f"URL scheme must be one of: {', '.join(sorted(allowed_schemes))}")
        if parsed.scheme in {"http", "https"} and not parsed.netloc:
            raise BrowserError("HTTP and HTTPS URLs must include a hostname")
  • BrowserState Pydantic model, the return type of navigate(). Contains session_id, current_url, title, window_handles, and active_window_handle.
    class BrowserState(BaseModel):
        session_id: str | None
        current_url: str | None
        title: str | None
        window_handles: list[str]
        active_window_handle: str | None
  • The _run helper used by navigate() to call the browser method, catch errors, and convert results to dict.
    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
Behavior1/5

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

No annotations provided; description does not disclose whether navigation replaces current page, waits for load, or any side effects. 'Allowed file URL' is vague.

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

Conciseness4/5

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

Single sentence is concise and front-loaded with action. Could expand slightly without losing conciseness.

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 tool simplicity (1 param, output schema exists), description provides basic understanding but lacks detail on behavior like page load waiting or error cases.

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?

Adds meaningful constraint that url must be http, https, or allowed file URL, beyond schema's generic string type. Schema coverage is 0%, so description compensates well.

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?

Description clearly states verb 'navigate' and resource 'browser to URL' with allowed schemes (http, https, file). Distinguishes from sibling navigation tools like go_back, go_forward, refresh.

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 navigate vs alternatives like open_new_tab or click on links. Does not specify context or limitations.

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