System tray lookFor¶
Goal¶
Enable agents to open the notification shade and wait for a matching notification by text.
Proposed MCP tool¶
systemTray({
action: "open" | "find" | "tap" | "dismiss" | "clearAll",
notification?: {
title?: string,
body?: string,
appId?: string,
tapActionLabel?: string
},
awaitTimeout?: number
})
Android implementation¶
Open/close the tray (preferred, emulator):
adb -s <device> shell cmd statusbar expand-notificationsadb -s <device> shell cmd statusbar collapse
Fallback (gesture):
- Swipe down from status bar if
cmd statusbaris unavailable.
Finding notifications:
- Use AccessibilityService to read the System UI node tree.
- Search for a node with matching text or resource ID in
com.android.systemui. - Return bounding box + hierarchy path for use in follow-up taps.
ADB validation (API 35)¶
Status:
- API 29 not validated yet (no local AVD available).
Confirmed commands:
- Expand/collapse notification shade:
adb -s <device> shell cmd statusbar expand-notificationsadb -s <device> shell uiautomator dump /sdcard/notification_dump.xmladb -s <device> shell cat /sdcard/notification_dump.xmladb -s <device> shell cmd statusbar collapse
Observed results:
- Notification shade expands and collapses on command.
- uiautomator dump contains notification text suitable for lookFor matching.
Notes:
adb shell cmd statusbar expand-settingsis also available to expand quick settings when needed.
Plan¶
- Add
systemTraywith open/find/tap/dismiss/clearAll actions. - Use accessibility node search to match notification text.
- Return structured match details for action chaining.
Risks¶
- OEM System UI layouts vary; emulator support may be the reliable baseline.
- Requires AccessibilityService access to System UI nodes.