{"tools":[{"name":"execute_js","description":"Execute JavaScript code in the browser preview iframe and get the result. Use this to test if code works, check DOM state, or debug issues.","input_schema":{"type":"object","properties":{"code":{"type":"string","description":"JavaScript code to execute in the iframe context"}},"required":["code"]}},{"name":"get_console_errors","description":"Get any JavaScript console errors from the preview iframe. Use this to check if there are runtime errors after applying code.","input_schema":{"type":"object","properties":{}}},{"name":"get_console_logs","description":"Get all console output (logs, warnings, errors) from the preview iframe.","input_schema":{"type":"object","properties":{"level":{"type":"string","description":"Filter by level: 'all', 'log', 'warn', 'error'. Default is 'all'."}}}},{"name":"check_element","description":"Check if a DOM element exists and get its properties (tagName, id, className, textContent, attributes)","input_schema":{"type":"object","properties":{"selector":{"type":"string","description":"CSS selector for the element"}},"required":["selector"]}},{"name":"click","description":"Click on an element in the preview iframe. Triggers click event and any associated handlers.","input_schema":{"type":"object","properties":{"selector":{"type":"string","description":"CSS selector for the element to click"}},"required":["selector"]}},{"name":"type_text","description":"Type text into an input, textarea, or contenteditable element. Clears existing value first unless append is true.","input_schema":{"type":"object","properties":{"selector":{"type":"string","description":"CSS selector for the input element"},"text":{"type":"string","description":"Text to type into the element"},"append":{"type":"boolean","description":"If true, append to existing value instead of replacing"}},"required":["selector","text"]}},{"name":"hover","description":"Hover over an element to trigger CSS :hover states and mouseenter/mouseover events.","input_schema":{"type":"object","properties":{"selector":{"type":"string","description":"CSS selector for the element to hover"}},"required":["selector"]}},{"name":"scroll","description":"Scroll the page or a specific element.","input_schema":{"type":"object","properties":{"selector":{"type":"string","description":"CSS selector for element to scroll. Omit to scroll the page."},"x":{"type":"number","description":"Horizontal scroll position or delta"},"y":{"type":"number","description":"Vertical scroll position or delta"},"behavior":{"type":"string","description":"'smooth' or 'instant'. Default is 'instant'."}}}},{"name":"wait_for_element","description":"Wait for an element to appear in the DOM. Useful after triggering async operations.","input_schema":{"type":"object","properties":{"selector":{"type":"string","description":"CSS selector for the element to wait for"},"timeout":{"type":"number","description":"Maximum time to wait in milliseconds. Default is 5000."},"visible":{"type":"boolean","description":"If true, wait for element to be visible, not just in DOM."}},"required":["selector"]}},{"name":"get_element_text","description":"Get the text content of an element.","input_schema":{"type":"object","properties":{"selector":{"type":"string","description":"CSS selector for the element"}},"required":["selector"]}},{"name":"get_computed_style","description":"Get computed CSS properties of an element. Useful for verifying styles are applied correctly.","input_schema":{"type":"object","properties":{"selector":{"type":"string","description":"CSS selector for the element"},"properties":{"type":"array","items":{"type":"string"},"description":"Array of CSS properties to get (e.g., ['color', 'backgroundColor', 'display'])"}},"required":["selector","properties"]}},{"name":"get_bounding_rect","description":"Get the position and size of an element (top, left, width, height, etc).","input_schema":{"type":"object","properties":{"selector":{"type":"string","description":"CSS selector for the element"}},"required":["selector"]}},{"name":"focus","description":"Focus on an input or other focusable element.","input_schema":{"type":"object","properties":{"selector":{"type":"string","description":"CSS selector for the element to focus"}},"required":["selector"]}},{"name":"press_key","description":"Press a keyboard key. Useful for testing keyboard interactions like Enter, Escape, Tab.","input_schema":{"type":"object","properties":{"key":{"type":"string","description":"Key to press: 'Enter', 'Escape', 'Tab', 'ArrowUp', 'ArrowDown', etc."},"selector":{"type":"string","description":"Optional: CSS selector for target element. If omitted, sends to focused element."},"modifiers":{"type":"array","items":{"type":"string"},"description":"Optional modifier keys: ['ctrl', 'shift', 'alt', 'meta']"}},"required":["key"]}},{"name":"select_option","description":"Select an option in a <select> dropdown element.","input_schema":{"type":"object","properties":{"selector":{"type":"string","description":"CSS selector for the select element"},"value":{"type":"string","description":"Value of the option to select"},"by_text":{"type":"boolean","description":"If true, match by visible text instead of value attribute"}},"required":["selector","value"]}},{"name":"get_all_elements","description":"Get info about all elements matching a selector. Useful for checking lists, tables, etc.","input_schema":{"type":"object","properties":{"selector":{"type":"string","description":"CSS selector for elements"},"limit":{"type":"number","description":"Maximum number of elements to return. Default is 10."}},"required":["selector"]}},{"name":"capture_screenshot","description":"Capture a screenshot of the current preview iframe for visual evaluation.","input_schema":{"type":"object","properties":{}}},{"name":"compare_screenshots","description":"Compare before and after screenshots to detect visual changes.","input_schema":{"type":"object","properties":{"before_id":{"type":"string","description":"ID of the before screenshot"},"after_id":{"type":"string","description":"ID of the after screenshot"}},"required":["before_id","after_id"]}}]}