scroll
Move through windows or pages using wheel input, element targeting, smart fallback, full-page capture, or OCR text extraction to reach and read content beyond the viewport.
Instructions
Purpose: Scroll a window or page. 5 strategies via action: 'raw' (wheel notches), 'to_element' (UIA name/automationId or CSS selector), 'smart' (auto-detect target with multi-strategy fallback), 'capture' (full-page stitched image), 'read' (scroll+OCR+dedupe → stitched text). Details: action='raw': send raw mouse-wheel notches at (x,y) or current cursor; the window is brought forward only with x/y. One amount unit is one wheel notch, and ≈10 notches move one screenful (see amount). action='to_element': scroll a named element into viewport (UIA or CDP). action='smart': handles nested scroll layers, virtualised lists, sticky-header occlusion. action='capture': stitches full-page images (caps at ~700KB raw); sizeReduced=true means downscaled. action='read': scrolls page-by-page, OCRs each viewport, deduplicates overlapping lines, returns stitched text; language auto-detected from OS locale if omitted. Prefer: Use action='to_element' or action='smart' for click target out-of-viewport recovery (entity_outside_viewport) — scrolling only helps when the target scrolled out of its own window; if desktop_act reported origin_window_not_visible, restore the window with focus_window and re-run desktop_discover instead. Use action='capture' for reading long pages as images. Use action='read' for extracting text from long native-app documents (PDF readers, text editors, terminals) where copy-paste is unavailable. For simple scroll without target, use action='raw'. Caveats: action='capture' returns stitched image — pixels do NOT match screen coords when sizeReduced=true, use for reading only, not mouse_click. action='smart' CDP path requires browser_open. action='to_element' native path requires element to implement UIA ScrollItemPattern. action='read' uses OCR (imperfect accuracy) and requires the window to be visible; for browser pages prefer browser_eval or browser_overview for accurate DOM text. action='capture' needs the window in front throughout: code:'ForegroundRestricted' if it cannot get it (nothing sent) or loses it before the first frame (context.lostPartWay: at most Ctrl+Home reached the target), code:'WindowOnOtherDesktop' off this desktop, code:'WindowBlockedByDialog' when its dialog disables it, stoppedReason:'foreground_lost' (frames kept) after that. action='read' needs it only for its key fallback: stoppedReason:'foreground_refused' (pages kept). action='raw' typed errors: code:'ScrollNotDelivered' on silent drop (overlay / non-scrollable / UIPI low-IL), and before sending when a Chrome/Edge page shows nowhere (focus_window({hwnd})); already-at-boundary is success via pre/post-percent disambiguation. hints.verifyDelivery.{channel,reason} per ADR-018 §2.6 — channel is the transport used ('uia'/'cdp'/'postmessage'/'wheel_send_input'); reason='pixel_delta_observed' = pixel evidence only (weak). reason='page_handled_wheel'/'hit_path_unobservable' (cdp) = unverifiable: the page cancelled the wheel / nothing scrollable seen at (x,y). action='smart' typed errors: code:'OverflowHiddenAncestor' (retry with expandHidden:true), code:'VirtualScrollExhausted' (provide virtualIndex); image road: code:'WindowOnOtherDesktop' / 'WindowBlockedByDialog'. Examples: scroll({action:'raw', direction:'down', amount:5, windowTitle:'Chrome'}) scroll({action:'to_element', name:'OK', windowTitle:'Dialog'}) scroll({action:'smart', target:'#create-release-btn'}) scroll({action:'capture', windowTitle:'Chrome', maxScrolls:10}) scroll({action:'read', windowTitle:'Acrobat', maxPages:15}) // OCR + dedupe long PDF
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>"
},
"name": "scroll"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | X coordinate to scroll at (moves cursor there first) | |
| y | No | Y coordinate to scroll at | |
| hint | No | Scroll direction hint for binary-search (image path). Seeds lo/hi bounds to reduce attempts. | |
| hwnd | No | Direct window handle ID (takes precedence over windowTitle). | |
| name | No | Partial name/label of the element (UIA name match). Use for native app elements. At least one of name or selector must be provided. | |
| port | No | 'to_element': CDP port for Chrome path (default 9222) 'smart': CDP port (default 9222) | |
| block | No | Vertical alignment after scroll — start/center/end/nearest (Chrome path only, default: center) | center |
| speed | No | Cursor movement speed in px/sec (0=teleport, omit=default) | |
| tabId | No | 'to_element': Tab ID (Chrome path only). Omit for first page tab. 'smart': CDP tab ID (Chrome path only). Omit for first page tab. | |
| action | Yes | Action selector — one of: raw, to_element, smart, capture, read. Per-action required fields are enforced at call time (see the tool description); this flat schema lists every action's fields as optional. | |
| amount | No | Number of scroll notches (default 3, max 1000). One notch = one physical wheel detent on every dispatch path. Count screenfuls, not lines: ≈10 notches move one screenful, so amount:3 (default) is about a third of a screen. UIA-capable apps (Notepad, Explorer, WPF) step ≈1/10 of the window's visible area per notch; browsers and WebView-based apps (Chrome, Electron, Tauri) move ≈100 px per notch. Exact distance depends on the app, the window size and the OS wheel-speed setting. The 1000-notch ceiling exists because each notch is dispatched as real wheel input; to reach a specific place in a long document use action='to_element' or action='smart' instead of a huge amount. | |
| homing | No | Apply window-movement homing correction to (x,y) before scrolling. Default true. | |
| inline | No | Vertical alignment after scroll (CDP path). Default: center. | center |
| target | No | CSS selector (Chrome/Edge) or partial UIA name (native apps). For CDP path, must be a valid CSS selector (starts with #, ., tag, or [ ). For UIA path, a partial name match against element Name property. | |
| include | No | Optional response-shape opt-in. `['envelope']` returns the self-documenting envelope (`_version` / `data` / `as_of` / `confidence`). `['raw']` forces raw shape (overrides DESKTOP_TOUCH_ENVELOPE=1 server default). Default behaviour is raw shape (compat with existing clients). | |
| language | No | OCR language code (e.g. 'ja', 'en', 'zh'). Omit to use the Windows locale's language. Pass the page's language when it differs. Windows reads with an installed OCR pack only: when the one asked for has none, the reply's language names the one that read, with a warning. | |
| maxDepth | No | Max number of ancestor scroll containers to walk. Default 3. | |
| maxPages | No | Maximum number of scroll steps / OCR pages (default 20, max 50). | |
| maxWidth | No | Max size of the short edge of the final image (default 1280). For 'down': caps the image width; height is unconstrained. For 'right': caps the image height; width is unconstrained. | |
| selector | No | CSS selector for the element (Chrome/Edge only). At least one of name or selector must be provided. | |
| strategy | No | auto (default): try CDP → UIA → image in order. cdp: Chrome/Edge only. uia: native Windows UIA. image: image + Win32 binary-search. | auto |
| direction | No | 'raw': Scroll direction 'smart': Scroll direction. into-view: scroll until target element is visible (default). Other values scroll unconditionally. 'capture': Scroll direction: 'down' (vertical, uses Page Down key) or 'right' (horizontal, uses mouse scroll). Default 'down'. | |
| scrollKey | No | Key sent to scroll one page. PageDown (default): full-page scroll for most apps. Space: web/PDF readers. ArrowDown: line-by-line slow scroll. | PageDown |
| maxScrolls | No | Maximum scroll iterations before stopping (default 10, max 30) | |
| retryCount | No | Max scroll attempts (image path binary-search). Default 3, cap 4. | |
| windowTitle | No | 'raw': Partial window title. With x/y (and homing on), the server brings this window forward before moving the cursor; without x/y it is not focused, and the wheel is sent to it. 'to_element': Partial window title (required for native path when name is used) 'smart': Partial window title. Required for UIA and image paths. For CDP path, optional. 'capture': Partial title of the window to capture (case-insensitive match) 'read': Partial window title to focus and OCR (case-insensitive match). | |
| expandHidden | No | Temporarily set overflow:hidden ancestors to overflow:auto to unlock scroll. Mutates live CSS. | |
| virtualIndex | No | Target row index in a virtualised list (0-based). Enables direct TanStack/data-index seeking. | |
| virtualTotal | No | Total row count in a virtualised list. Required when virtualIndex is set. | |
| scrollDelayMs | No | 'capture': Milliseconds to wait after each scroll for rendering to settle (default 400). Increase for slow/animated pages. 'read': Milliseconds to wait after each scroll for rendering to settle (default 400). | |
| verifyWithHash | No | Verify scroll effectiveness via perceptual hash comparison. Automatically enabled for image path. | |
| stopWhenNoChange | No | Stop automatically when two consecutive pages yield no new lines after deduplication (page-end detection). Default true. |