use_browser
Control a Chrome browser to perform DOM actions: navigate, click, type, and more. Each action automatically saves screenshots and page content.
Instructions
Control persistent Chrome browser with automatic page capture.
Every DOM action (navigate, click, type, select, eval) auto-captures to the session dir:
{prefix}.png — viewport screenshot
{prefix}.md — page content as structured markdown
{prefix}.html — full rendered DOM
{prefix}-console.txt — browser console messages
Prefer reading these files to using 'extract' or 'screenshot' whenever possible.
Schema: 4 parameters — action, selector (CSS/XPath or null), payload (string or object), timeout (ms). selector targets a DOM element (null/omit for navigation, eval, tab management, etc.). payload is a string for simple actions (navigate=URL, type=text, eval=JS, keyboard_press=key). payload is an object for structured actions (set_viewport={width,height}, drag_drop={target}, etc.). Tabs are tracked as sticky state; use switch_tab to change the active tab. Use action='help' for full per-action payload shapes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | Yes | Action to perform. action='help' lists all actions with payload shapes. | |
| selector | No | CSS or XPath selector — what to act on. Null/omitted for actions that don't target an element (navigate, eval, list_tabs, etc.). XPath must start with / or //. dialog::accept and dialog::dismiss are special selectors for handling open dialogs. | |
| payload | No | Extra data for the action. String for simple cases (navigate=URL, type=text, eval=JS, keyboard_press=key, set_profile=name, new_tab=URL). Object for structured cases (set_viewport={width,height,mobile?}, keyboard_press={key,modifiers:{shift?,ctrl?,alt?,meta?}}, extract={format:'text'|'html'|'markdown'}, screenshot={path?,fullpage?}, scroll={deltaX?,deltaY?} or direction string, drag_drop={x,y} or selector string for target, mouse_move={x,y,steps?,fromX?,fromY?}, file_upload={files:[...]}, get_console_messages={since:epochMs}, await_text=text string or {text,timeout?}, switch_tab=tab index/url-substring/title-substring). See action='help' for per-action payload shapes. | |
| timeout | No | Timeout in ms for await_element / await_text actions. | |
| tab_index | No | Legacy: behaves like switch_tab. Sets the active tab to this index before running the action. Prefer the switch_tab action. |