Skip to main content
Glama
dragons96

MCP-Undetected-Chromedriver

by dragons96

browser_screenshot

Capture webpage or element screenshots and save them in desired formats or directories using Chrome automation with anti-bot detection bypass.

Instructions

Take a screenshot of the current page or a specific element

Args:
    name: The name of the screenshot - required, default is "screenshot"
    storeBase64: Whether to store the screenshot as a base64 string - optional, default is True
    downloadsDir: The directory to save the screenshot to - optional, default is the user's Downloads directory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
downloadsDirNo
nameYes
storeBase64No

Implementation Reference

  • The main handler function for the 'browser_screenshot' tool. It takes a screenshot of the current browser page, saves it to a specified directory with a timestamped filename, and optionally stores the base64 encoded image in memory under the given name. Uses undetected_chromedriver and handles browser state via shared global webdriver.
    @mcp.tool()
    async def browser_screenshot(
            name: str,
            storeBase64: bool = True,
            downloadsDir: str = None,
    ):
        """Take a screenshot of the current page or a specific element
    
        Args:
            name: The name of the screenshot - required, default is "screenshot"
            storeBase64: Whether to store the screenshot as a base64 string - optional, default is True
            downloadsDir: The directory to save the screenshot to - optional, default is the user's Downloads directory
        """
        name = name or "screenshot"
    
        async def screenshot_handler(driver: uc.Chrome):
            timestamp = datetime.datetime.now().strftime("%Y-%m-%d %H-%M-%S")
            filename = f"{name}-{timestamp}.png"
            download_dir = downloadsDir or DEFAULT_DOWNLOAD_PATH
    
            os.makedirs(download_dir, exist_ok=True)
    
            output_path = os.path.join(download_dir, filename)
            driver.save_screenshot(output_path)
    
            messages = [f"Screenshot saved to: {os.path.relpath(output_path, os.getcwd())}"]
    
            if storeBase64:
                base64 = driver.get_screenshot_as_base64()
                SCREENSHOTS[name] = base64
                # todo: notifications/resources/list_changed
                messages.append(f"Screenshot also stored in memory with name: {name}")
    
            return await create_success_response(messages)
    
        return await tool.safe_execute(
            ToolContext(webdriver=await ensure_browser()), screenshot_handler
        )
  • The @mcp.tool() decorator registers the browser_screenshot function as an MCP tool.
    @mcp.tool()
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that screenshots can be saved to a directory or stored as base64, but fails to cover critical aspects such as whether this requires specific permissions, what happens if the page isn't loaded, error handling, or the format of the output. For a tool with no annotation coverage, this leaves significant gaps.

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?

The description is appropriately sized and front-loaded, starting with the core purpose. The parameter explanations are concise and directly relevant. However, the structure could be improved by separating usage guidance from parameter details, and some sentences could be more tightly integrated.

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

Completeness2/5

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

Given the complexity of a screenshot tool with no annotations, no output schema, and 3 parameters, the description is incomplete. It lacks information on output format (e.g., what is returned when storeBase64 is true/false), error conditions, prerequisites (e.g., requires an open browser page), and how it interacts with sibling tools. This leaves the agent with insufficient context for reliable use.

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 beyond the input schema by explaining the purpose of each parameter (e.g., 'name' is for the screenshot name, 'storeBase64' for base64 storage, 'downloadsDir' for save location). However, with 0% schema description coverage, it doesn't fully compensate—details like default values or specific constraints are missing. The baseline is adjusted due to the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Take a screenshot') and resources ('current page or a specific element'), distinguishing it from sibling tools like browser_save_as_pdf or browser_get_visible_html. However, it doesn't explicitly differentiate from all siblings, such as browser_click or browser_hover, which are also page interaction tools.

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 is provided on when to use this tool versus alternatives. For example, it doesn't mention when to choose browser_screenshot over browser_save_as_pdf for capturing page content, or how it relates to other browser interaction tools like browser_get_visible_html. The description lacks context for decision-making.

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/dragons96/mcp-undetected-chromedriver'

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