AccessibilityTools

Provider object for the accessibility module — the entry point host apps and dispatchers use to register the tools and inspect their special-access state.

Every tool here operates on android.view.accessibility.AccessibilityNodeInfo trees obtained from the host's bound DroidMcpAccessibilityService (tracked by AccessibilityServiceHolder). Because accessibility is a special access permission granted from system Settings — not a runtime permission — requiredPermissions is empty and hasPermissions is a no-op true; use isAccessibilityEnabled / permissionStatus to learn whether tools will actually succeed.

Tools surface a mix of error shapes: the 0.7.0 coord/find tools and the polling tools emit short-form codes (accessibility_not_enabled, node_not_found, node_not_editable, invalid_selector, invalid_coords, gesture_failed, scroll_exhausted); the older tools emit the long-form notConnectedError sentence (see each tool's KDoc).

Properties

Link copied to clipboard

The subset of global_action action strings that are safe to retry — state-toggles or navigations whose final state is the same regardless of how many times the call runs. Dispatchers consume this to attach idempotentHint = true at call-site rather than splitting global_action into one tool per action.

Functions

Link copied to clipboard
fun all(context: Context): List<McpTool>

All accessibility tools, constructed against context. Includes take_screenshot_via_a11y regardless of API level — call supportedTools to get the device-filtered set instead.

Link copied to clipboard

Convention method matching other modules; always returns true because the runtime-permission concept doesn't apply here. To know whether the service is actually bound and tools will succeed, call isAccessibilityEnabled (or permissionStatus) instead.

Link copied to clipboard

True when the host app's DroidMcpAccessibilityService is currently bound to the system.

Link copied to clipboard

Special-access status of the accessibility service. Returns a Granted when bound, otherwise NotGranted carrying the Settings intent so the host can render an inline Grant card.

Link copied to clipboard

Accessibility-service access is a special access permission granted via system Settings, not a runtime permission — so there are no Manifest.permission.* entries to declare or request.

Link copied to clipboard

Tool names supported on the current device. Filters out API-gated tools the runtime can't actually run (e.g. take_screenshot_via_a11y on API <30). Dispatchers use this to hide unsupported tools from the LLM before tool-call time.