Skip to main content
Glama
dragons96

MCP-Undetected-Chromedriver

by dragons96

browser_iframe_click

Interact with elements inside iframes using this tool. It automates clicks on specific elements within iframes, simplifying web automation and scraping tasks on protected sites with anti-bot measures.

Instructions

Click an element inside an iframe on the page

Args:
    iframeSelector: The selector of the iframe - required
    selector: The selector of the element to click - required

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
iframeSelectorYes
selectorYes

Implementation Reference

  • The handler function for browser_iframe_click tool. It validates inputs, switches to the specified iframe using Selenium, clicks the target element by CSS selector, switches back to default content, and returns a success response. Registered as an MCP tool via the @mcp.tool() decorator.
    @mcp.tool()
    async def browser_iframe_click(
            iframeSelector: str,
            selector: str,
    ):
        """Click an element inside an iframe on the page
    
        Args:
            iframeSelector: The selector of the iframe - required
            selector: The selector of the element to click - required
        """
        assert iframeSelector, "Iframe selector is required"
        assert selector, "Selector is required"
    
        async def iframe_click_handler(driver: uc.Chrome):
            iframe = driver.find_element(By.CSS_SELECTOR, iframeSelector)
            driver.switch_to.frame(iframe)
            driver.find_element(By.CSS_SELECTOR, selector).click()
            driver.switch_to.default_content()
            return await create_success_response(
                f"Clicked element {selector} inside iframe {iframeSelector}"
            )
    
        return await tool.safe_execute(
            ToolContext(webdriver=await ensure_browser()), iframe_click_handler
        )
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 of behavioral disclosure. It mentions the action ('Click') but does not cover critical aspects like error handling (e.g., if the iframe or element is not found), side effects (e.g., page navigation or state changes), or performance considerations. This leaves significant gaps in understanding the tool's behavior.

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 front-loaded with the core purpose in the first sentence, followed by a clear parameter list. It avoids unnecessary words, but the formatting with 'Args:' could be slightly more integrated. Overall, it is efficient and well-structured for quick comprehension.

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 interacting with iframes and no annotations or output schema, the description is incomplete. It misses details on return values, error cases, and interaction nuances (e.g., if the click triggers JavaScript events). For a tool with potential side effects and technical requirements, this leaves the agent under-informed.

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 basic meaning by explaining that 'iframeSelector' targets the iframe and 'selector' targets the element to click, which is helpful since schema description coverage is 0%. However, it does not provide details on selector syntax, examples, or constraints, so the value beyond the schema is limited to high-level intent.

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 action ('Click an element') and the resource ('inside an iframe on the page'), making the purpose specific and understandable. However, it does not explicitly differentiate from sibling tools like 'browser_click' (which likely clicks elements outside iframes), leaving room for ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying 'inside an iframe,' suggesting it should be used for iframe-contained elements versus 'browser_click' for non-iframe elements. However, it lacks explicit guidance on when to choose this tool over alternatives or any prerequisites, such as requiring the iframe to be accessible.

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