Skip to main content
Glama

browser.find_by_vision

Locate web elements using natural language descriptions when CSS selectors fail. Returns clickable coordinates for browser automation.

Instructions

Use Claude Vision to find an element from a natural language description. Returns (x, y) coordinates you can pass to browser.execute_action click. Use when CSS selectors fail or the element has no reliable text anchor.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_idYes
descriptionYes
take_screenshotNo

Implementation Reference

  • The handler implementation for the browser.find_by_vision tool. It uses a VisionTargeter (injected in the gateway) to identify elements on a screenshot.
    async def _find_by_vision(self, payload: VisionFindInput) -> dict[str, Any]:
        if self.vision_targeter is None:
            raise RuntimeError(
                "Vision targeting is not available — set ANTHROPIC_API_KEY to enable it."
            )
        session = await self.manager.get_session(payload.session_id)
        if payload.take_screenshot:
            screenshot = await self.manager.capture_screenshot(payload.session_id, label="vision")
            screenshot_path = screenshot["screenshot_path"]
        else:
            # Use the most recent screenshot if available
            screenshots = sorted(
                session.artifact_dir.glob("*.png"),
                key=lambda p: p.stat().st_mtime,
                reverse=True,
            )
            if not screenshots:
                raise RuntimeError("No screenshots available — take one first")
            screenshot_path = str(screenshots[0])
    
        result = await self.vision_targeter.find_element(screenshot_path, payload.description)
        return {"session_id": payload.session_id, **result}
  • Input schema for browser.find_by_vision tool, inheriting from SessionIdInput and defining the vision query parameters.
    class VisionFindInput(SessionIdInput):
        description: str = Field(min_length=1, max_length=500)
        take_screenshot: bool = True
  • The tool registration for browser.find_by_vision in the McpToolGateway, binding the input schema and handler.
    ToolSpec(
        name="browser.find_by_vision",
        description=(
            "Use Claude Vision to find an element from a natural language description. "
            "Returns (x, y) coordinates you can pass to browser.execute_action click. "
            "Use when CSS selectors fail or the element has no reliable text anchor."
        ),
        input_model=VisionFindInput,
        handler=self._find_by_vision,
    ),
Behavior4/5

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

With no annotations, description carries full burden and successfully discloses the AI mechanism ('Claude Vision') and return format ('(x, y) coordinates'). Does not mention error handling or rate limits, but covers the critical behavioral trait that this is a visual AI operation.

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?

Two high-density sentences with zero waste. First sentence covers purpose and return value; second covers usage guidelines. Front-loaded with the most critical information (Claude Vision capability).

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?

Adequate for a 3-parameter tool with no output schema—description proactively explains the coordinate return value. Misses only failure mode documentation (what happens when element not found) given the complexity of AI-based visual search.

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?

Schema coverage is 0%, requiring description to compensate. It explains the 'description' parameter via 'natural language description' context. However, 'session_id' and 'take_screenshot' are undocumented in both schema and description, though the former is standard across browser tools and the latter has a clear title/default.

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?

Specific verb-resource combination ('Use Claude Vision to find an element') with clear mechanism (natural language description). Explicitly distinguishes from sibling CSS-based tools by mentioning 'CSS selectors fail' as the alternative case.

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

Usage Guidelines5/5

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

Explicit when-to-use guidance ('Use when CSS selectors fail or the element has no reliable text anchor') clearly differentiates from browser.find_elements. Also specifies output consumer ('pass to browser.execute_action click'), establishing the tool chain.

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/LvcidPsyche/auto-browser'

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