Package-level declarations
Types
Process-wide handle to the host app's DroidMcpAccessibilityService instance. Set automatically when the service connects to the system, cleared on disconnect / destroy. Tools call through this rather than relying on Context.getSystemService(AccessibilityService::class.java), which doesn't give back the running service instance.
Provider object for the accessibility module — the entry point host apps and dispatchers use to register the tools and inspect their special-access state.
click_node — resolve a node via the shared selector and perform ACTION_CLICK on it. See perform for the result/error shape; on success returns success, action = "click", and the matched view_id.
Abstract base service that host apps subclass to grant droid-mcp the ability to read the on-screen UI and dispatch clicks / gestures / scrolls.
find_and_tap — find the first node matching match (per match_kind) and perform ACTION_CLICK on it in one call: a composition of find_node + click_node.
find_node — search the active window's UI tree for nodes matching any combination of text, view_id, class_name, or package_name and return the matches as projections shaped like query_screen entries (see NodeQuery.toMap).
gesture — dispatch a single-stroke touch gesture via AccessibilityService.dispatchGesture and await the system callback so the call returns only when the gesture completes (or is cancelled).
get_active_window_info — return the foreground package plus the active window's root-node class (typically the foreground activity's view-root class). Cheap and read-only; safe to poll.
global_action — dispatch a system-wide AccessibilityService global action: back, home, recents, notifications, quick_settings, power_dialog, lock_screen, or screenshot (see the companion MAP).
long_click_node — resolve a node via the shared selector and perform ACTION_LONG_CLICK on it. See perform for the result/error shape; on success returns success, action = "long_click", and the matched view_id.
long_press — dispatch a long-press gesture (a held stroke via tapPath) at the given screen coordinates and await completion.
query_screen — dump the active window's AccessibilityNodeInfo tree as a flat, ranked list of node projections.
scroll_node — scroll a scrollable node forward or backward via ACTION_SCROLL_FORWARD / ACTION_SCROLL_BACKWARD.
scroll_to_find — repeatedly swipe in direction until match appears in the active window's UI tree or max_scrolls is exhausted. The current screen is checked first, so a match already visible on iteration 0 returns without any swipe.
set_node_text — replace the text of an editable node via ACTION_SET_TEXT. Works for most native EditText fields; some apps disable accessibility text-set, in which case the IME tools are the fallback.
take_screenshot_via_a11y — capture the screen via AccessibilityService.takeScreenshot, awaiting the system callback. Unlike the screenshot module's MediaProjection path, this needs no consent prompt, but it requires API 30+ (the tool is filtered out of AccessibilityTools.supportedTools below that).
wait_for_text — block (with timeout) until a condition holds on screen. Two modes selected by the condition param: