Skip to main content
Glama

multi_click

Click multiple labeled elements simultaneously to solve CAPTCHAs, select checkboxes, or perform batch interactions on web pages.

Instructions

Click multiple elements at once (useful for CAPTCHA, checkboxes, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
label_idsYesList of label IDs to click (e.g., [1, 5, 8])

Implementation Reference

  • The _multi_click method implements the core logic for clicking multiple elements by label IDs. It validates input, iterates through label IDs, performs humanized clicks for each valid element, tracks results, and returns an observation with click details.
    def _multi_click(self, label_ids: list = None, **_) -> BrowserResult:
        """Click multiple elements (for CAPTCHA, checkboxes, etc.)"""
        if not label_ids:
            return BrowserResult(success=False, error="label_ids required (e.g., [1, 5, 8])")
        
        if self._page is None:
            return BrowserResult(success=False, error="No page open")
        
        self._page.evaluate("() => document.querySelectorAll('.atlas-som-label').forEach(el => el.remove())")
        
        results = []
        
        for label_id in label_ids:
            if label_id not in self._element_map:
                results.append({"label_id": label_id, "success": False, "error": "Not found"})
                continue
            
            element = self._element_map[label_id]
            
            try:
                self._human_click_at(
                    element['x'],
                    element['y'],
                    element['width'],
                    element['height']
                )
                results.append({"label_id": label_id, "success": True})
                
                if self._humanize:
                    time.sleep(random.uniform(0.15, 0.35))
                    
            except Exception as e:
                results.append({"label_id": label_id, "success": False, "error": str(e)})
        
        self._page.wait_for_timeout(300)
        
        observe_result = self._observe()
        
        if observe_result.success:
            observe_result.data["clicks"] = results
            observe_result.data["clicked_count"] = sum(1 for r in results if r.get("success"))
        
        return observe_result
  • Tool schema definition for multi_click, specifying it accepts a 'label_ids' array of integers. This defines the input/output contract for the MCP tool.
    Tool(
        name="multi_click",
        description="Click multiple elements at once (useful for CAPTCHA, checkboxes, etc.)",
        inputSchema={
            "type": "object",
            "properties": {
                "label_ids": {
                    "type": "array",
                    "items": {"type": "integer"},
                    "description": "List of label IDs to click (e.g., [1, 5, 8])"
                }
            },
            "required": ["label_ids"]
        }
    ),
  • Action mapping in the execute method that registers 'multi_click' string to the _multi_click handler method, making it available as a browser action.
    actions = {
        "navigate": self._navigate,
        "observe": self._observe,
        "click": self._click,
        "multi_click": self._multi_click,
        "type": self._type,
        "scroll": self._scroll,
        "close": self._close
    }
  • The call_tool handler that routes 'multi_click' tool invocations to the browser.execute method with the appropriate action and label_ids arguments.
    elif name == "multi_click":
        result = await asyncio.to_thread(
            browser.execute,
            action="multi_click",
            label_ids=arguments.get("label_ids")
        )
  • Special formatting in format_result to include multi_click specific data (clicks array and clicked_count) in the MCP response.
    # 如果是 multi_click,加入點擊結果
    if "clicks" in data:
        info["clicks"] = data["clicks"]
        info["clicked_count"] = data.get("clicked_count", 0)
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. It mentions the action ('click') and context ('CAPTCHA, checkboxes'), but doesn't disclose behavioral traits like whether it requires specific permissions, how it handles errors, if it's synchronous/asynchronous, or what the visual/state impact is. This leaves significant gaps for a mutation tool.

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, efficient sentence that front-loads the core functionality ('Click multiple elements at once') and adds a brief, useful example context. There is no wasted verbiage, making it highly concise and well-structured.

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 no annotations, no output schema, and a mutation tool with one parameter, the description is incomplete. It lacks details on behavioral aspects (e.g., side effects, error handling), return values, and explicit differentiation from siblings. For a tool that performs actions like clicking, this leaves too many unknowns for effective agent 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 schema description coverage is 100%, with the parameter 'label_ids' fully documented in the schema. The description adds no additional parameter information beyond what the schema provides, such as format details or constraints. Baseline 3 is appropriate as the schema does the heavy lifting.

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 multiple elements at once') and the resource ('elements'), with a specific example use case ('CAPTCHA, checkboxes, etc.'). However, it doesn't explicitly differentiate from the sibling 'click' tool, which presumably clicks single elements.

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 for batch operations like CAPTCHA or checkboxes, suggesting when it might be preferred over single clicks. But it doesn't explicitly state when to use this versus the 'click' sibling or other alternatives, nor does it provide exclusions or prerequisites.

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/LingTravel/Atlas-Browser'

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