Skip to main content
Glama
Lokii0911
by Lokii0911

refresh

Refresh the current browser page to load updated content and re-render elements.

Instructions

Refresh the current page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'refresh' — decorated with @mcp.tool() and delegates to browser.refresh via the _run helper.
    @mcp.tool()
    def refresh() -> dict[str, Any]:
        """Refresh the current page."""
        return _run("refresh", browser.refresh)
    
    
    @mcp.tool()
    def set_window_size(width: int, height: int) -> dict[str, Any]:
        """Set the browser window size."""
        return _run("set_window_size", browser.set_window_size, width, height)
    
    
    @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)
    
    
    @mcp.tool()
    def switch_window(handle: str) -> dict[str, Any]:
        """Switch to a browser window or tab by Selenium window handle."""
        return _run("switch_window", browser.switch_window, handle)
    
    
    @mcp.tool()
    def close_window() -> dict[str, Any]:
        """Close the active browser window or tab."""
        return _run("close_window", browser.close_window)
    
    
    @mcp.tool()
    def find_element(
  • The @mcp.tool() decorator on the refresh() function registers it as an MCP tool with the FastMCP server instance.
    @mcp.tool()
    def refresh() -> dict[str, Any]:
        """Refresh the current page."""
        return _run("refresh", browser.refresh)
  • The BrowserManager.refresh() method which acquires the lock, calls Selenium's WebDriver.refresh(), and returns the current BrowserState.
    def refresh(self) -> BrowserState:
        with self._lock:
            self._require_driver().refresh()
            return self.state()
  • The _run helper function used by the refresh handler to execute the browser method, convert its result to a dict via _as_dict, and handle exceptions.
    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
Behavior2/5

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

No annotations provided, and the description does not disclose behavioral traits such as whether it waits for full load, effect on form data, or triggers events. It only states the action.

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, concise sentence with no unnecessary words or information.

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 simplicity of the tool, the description is adequately complete. The output schema exists, so return values are documented elsewhere. However, it could mention that it reloads the current URL.

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?

With zero parameters, the baseline is 4. The description sufficiently conveys what the tool does without needing parameter 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 'Refresh the current page' clearly states the action (refresh) on a specific resource (current page), distinguishing it from sibling tools like navigate, click, etc.

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 refresh versus alternatives like navigate to the same URL. The description implies usage for stale pages but not explicit.

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