# 🛠️ Browser Tools Reference Complete reference for all browser automation tools available to the AI agent. ## Core Analysis Tools ### `analyze_page` Scans the current page's DOM to create a map of all interactive elements with numbered IDs. **Usage:** ```python analyze_page() ``` **Returns:** - Numbered list of all interactive elements - Element types (button, link, input, etc.) - Element text content - Element attributes and properties **Example Output:** ``` [1][button]Sign Up [2][link]Learn More [3][input]Email Address (placeholder: Enter your email) [4][select]Country [5][checkbox]I agree to terms ``` **When to Use:** - After navigating to a new page - After page content changes dynamically - Before attempting to interact with elements - When element IDs have changed ## Navigation Tools ### `navigate` Navigate to a specific URL. **Usage:** ```python navigate("https://example.com") ``` **Parameters:** - `url` (string): The URL to navigate to **Features:** - Automatic protocol detection (adds https:// if missing) - Waits for page to fully load - Handles redirects automatically - Returns navigation status ### `go_back` Navigate to the previous page in browser history. **Usage:** ```python go_back() ``` **Features:** - Works like the browser's back button - Maintains page state - Handles history availability ### `scroll` Scroll the page viewport in specified directions. **Usage:** ```python scroll("down") # Scroll down scroll("up") # Scroll up scroll("top") # Scroll to top scroll("bottom") # Scroll to bottom ``` **Parameters:** - `direction` (string): "up", "down", "top", "bottom" **Features:** - Detects scroll boundaries - Returns feedback about scroll limits - Smooth scrolling animation ## Element Interaction Tools ### `click` Click on elements using various identification methods. **Usage:** ```python # Using element ID from analyze_page click("[3][button]Submit") # Using JSON object click({"id": "3", "type": "button", "text": "Submit"}) # Using natural language click("Submit button") ``` **Parameters:** - `target_description`: Element identifier (ID, JSON object, or description) **Features:** - Multiple identification strategies - Automatic scrolling to element - Visibility verification - Retry mechanisms on failure ### `type` Types text into the currently focused element. **Usage:** ```python type("Hello, World!") ``` **Parameters:** - `value` (string): Text to type **Features:** - Clears existing text first (Ctrl+A/Cmd+A) - Natural typing simulation - Works with any text input element **Workflow:** 1. Click on input field to focus it 2. Use `type()` to enter text ### `select_option` Select options from dropdown menus and select elements. **Usage:** ```python select_option({ "id": "5", "type": "dropdown", "text": "Country", "value": "USA" }) ``` **Parameters:** - `json_input`: JSON object with target and value information **JSON Format:** ```json { "id": "element_id", "type": "dropdown", "text": "element_description", "value": "option_to_select" } ``` **Features:** - Works with standard HTML `