{"at":"2026-11-23T01:14:29.532Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T01:14:29.980Z","dir":"received","era":"server_discover","message":{"error":{"code":-32601,"message":"Method not found"},"id":1,"jsonrpc":"2.0"}}
{"at":"2026-11-23T01:14:30.081Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T01:14:30.607Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"tools":{"listChanged":true}},"protocolVersion":"2025-11-25","serverInfo":{"name":"androidmcp-framework","version":"0.1.12"}}}}
{"at":"2026-11-23T01:14:30.607Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T01:14:30.607Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T01:14:30.612Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":true},"description":"List every connected Android target - booted emulators and physical devices together, the same way `adb devices -l` does. Each entry reports id (adb serial), type ('emulator'|'physical'), state, and avdName when resolvable.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"list_devices","title":"List Devices"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false},"description":"Compile-only build for a Gradle module + variant (assemble<Variant>). Does not install or launch. Works identically whether you plan to target an emulator or a physical device - both use the same adb, unlike Xcode's simulator/device split.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"extraArgs":{"description":"Extra raw Gradle CLI args, e.g. [\"--stacktrace\"].","items":{"type":"string"},"type":"array"},"module":{"description":"Gradle module path, e.g. \":app\". Falls back to sessionDefaults.module.","type":"string"},"projectPath":{"description":"Gradle project root. Falls back to sessionDefaults.projectPath.","type":"string"},"variant":{"description":"Build variant, e.g. \"debug\" or \"devDebug\". Falls back to sessionDefaults.variant.","type":"string"}},"type":"object"},"name":"build_device","title":"Build (Device)"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"One-shot: build a module + variant, install it, and launch it. Resolves the target automatically - an explicit targetId wins, then the active session default, then whichever single emulator/device is connected; if more than one is connected without a pin, this fails with the candidate list instead of guessing. Launches via the default launcher activity unless `activity` is given.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"activity":{"description":"Fully-qualified activity to launch, e.g. \"com.example.app.MainActivity\". Defaults to the app's launcher activity.","type":"string"},"extraArgs":{"items":{"type":"string"},"type":"array"},"module":{"type":"string"},"projectPath":{"type":"string"},"targetId":{"description":"adb serial. Auto-resolved if omitted.","type":"string"},"variant":{"type":"string"}},"type":"object"},"name":"build_run_device","title":"Build, Install, and Launch"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false},"description":"Install an already-built APK for a module + variant onto the resolved target. Does not rebuild - run build_device first if sources changed. Pass apkPath directly to skip variant lookup entirely.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"apkPath":{"description":"Explicit path to a .apk, bypassing module/variant lookup.","type":"string"},"module":{"type":"string"},"projectPath":{"type":"string"},"reinstall":{"description":"Pass -r to adb install to keep existing app data. Default true.","type":"boolean"},"targetId":{"type":"string"},"variant":{"type":"string"}},"type":"object"},"name":"install_app_device","title":"Install App"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Launch an already-installed app on the resolved target. Provide packageId directly, or module/variant to look it up from the last build's APK. Uses the app's default launcher activity unless `activity` is given.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"activity":{"type":"string"},"module":{"type":"string"},"packageId":{"description":"Application id, e.g. \"com.example.app\". Resolved from the built APK if omitted.","type":"string"},"projectPath":{"type":"string"},"targetId":{"type":"string"},"variant":{"type":"string"}},"type":"object"},"name":"launch_app_device","title":"Launch App"},{"annotations":{"destructiveHint":true,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false},"description":"Force-stop a running app on the resolved target (adb shell am force-stop).","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"packageId":{"description":"Application id, e.g. \"com.example.app\".","type":"string"},"targetId":{"type":"string"}},"required":["packageId"],"type":"object"},"name":"stop_app_device","title":"Stop App"},{"annotations":{"destructiveHint":true,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false},"description":"Uninstall an app (and its data) from the resolved target.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"keepData":{"description":"Pass -k to adb uninstall to keep app data/cache. Default false.","type":"boolean"},"packageId":{"type":"string"},"targetId":{"type":"string"}},"required":["packageId"],"type":"object"},"name":"uninstall_app_device","title":"Uninstall App"},{"annotations":{"destructiveHint":true,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false},"description":"Reset an app to first-install state on the resolved target (adb shell pm clear) - wipes the app's data and cache without uninstalling it.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"packageId":{"type":"string"},"targetId":{"type":"string"}},"required":["packageId"],"type":"object"},"name":"clear_app_data_device","title":"Clear App Data"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Run tests for a module + variant. `instrumented` (default) runs connected<Variant>AndroidTest against the resolved target via ANDROID_SERIAL - needs an emulator or device attached. `unit` runs test<Variant>UnitTest on the JVM instead and needs no target at all.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"extraArgs":{"items":{"type":"string"},"type":"array"},"kind":{"description":"Defaults to \"instrumented\".","enum":["instrumented","unit"],"type":"string"},"module":{"type":"string"},"projectPath":{"type":"string"},"targetId":{"type":"string"},"variant":{"type":"string"}},"type":"object"},"name":"test_device","title":"Test (Device)"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false},"description":"Copy a local file or directory onto the resolved target (adb push).","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"localPath":{"type":"string"},"remotePath":{"type":"string"},"targetId":{"type":"string"}},"required":["localPath","remotePath"],"type":"object"},"name":"push_file_device","title":"Push File"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Copy a file or directory off the resolved target onto the local filesystem (adb pull).","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"localPath":{"type":"string"},"remotePath":{"type":"string"},"targetId":{"type":"string"}},"required":["remotePath","localPath"],"type":"object"},"name":"pull_file_device","title":"Pull File"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":true},"description":"Capture a semantic UI hierarchy for the current screen - every element gets a short-lived elementRef (e1, e2, ...) that tap/long_press/type_text can target directly. Saves the captured hierarchy as JSON under .androidmcp-framework/artifacts/ui-snapshots/ by default.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"interactiveOnly":{"description":"Default true: only clickable/focusable/scrollable/checkable elements or ones with text/content-desc. false returns the full raw tree.","type":"boolean"},"projectPath":{"description":"Project root for the saved JSON snapshot; defaults to the current working directory.","type":"string"},"targetId":{"type":"string"}},"type":"object"},"name":"snapshot_ui","title":"Snapshot UI"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Tap either a raw (x, y) point or an elementRef from the latest snapshot_ui output. Prefer elementRef - it survives minor layout shifts that would break a hard-coded coordinate.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"elementRef":{"type":"string"},"targetId":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"}},"type":"object"},"name":"tap","title":"Tap"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Long-press either a raw (x, y) point or an elementRef from the latest snapshot_ui output.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"durationMs":{"description":"Default 600.","type":"number"},"elementRef":{"type":"string"},"targetId":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"}},"type":"object"},"name":"long_press","title":"Long Press"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Swipe either by explicit start/end coordinates, or a screen-relative direction (\"up\"|\"down\"|\"left\"|\"right\") computed from the current screen size.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"direction":{"enum":["up","down","left","right"],"type":"string"},"distance":{"description":"Screen-relative distance for direction mode, 0-1. Default 0.6.","type":"number"},"durationMs":{"description":"Default 300.","type":"number"},"endX":{"type":"number"},"endY":{"type":"number"},"startX":{"type":"number"},"startY":{"type":"number"},"targetId":{"type":"string"}},"type":"object"},"name":"swipe","title":"Swipe"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Press-and-drag from one point to another (adb shell input draganddrop) - for reordering list items or drag targets, where a quick swipe would be interpreted as a flick instead of a hold-and-move. Endpoints can be elementRefs from the latest snapshot_ui, or raw coordinates.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"durationMs":{"description":"Default 800.","type":"number"},"endElementRef":{"type":"string"},"endX":{"type":"number"},"endY":{"type":"number"},"startElementRef":{"type":"string"},"startX":{"type":"number"},"startY":{"type":"number"},"targetId":{"type":"string"}},"type":"object"},"name":"drag","title":"Drag"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Type text into whatever field currently has focus. If elementRef is given, taps it first to focus it, then types. Only ASCII-range and common Latin text renders reliably through adb input text - non-Latin scripts and emoji generally need an IME-level workaround this tool does not attempt.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"elementRef":{"description":"Tapped first to focus, if given.","type":"string"},"targetId":{"type":"string"},"text":{"type":"string"}},"required":["text"],"type":"object"},"name":"type_text","title":"Type Text"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Send one hardware/software key event (adb shell input keyevent). Accepts either a symbolic Android keycode name (KEYCODE_BACK, KEYCODE_ENTER, KEYCODE_DEL, KEYCODE_TAB) or its numeric code. Prefer button for common hardware buttons (home/back/recents/power/volume) - it maps friendly names for you.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"keyCode":{"description":"e.g. \"KEYCODE_ENTER\" or \"66\".","type":"string"},"targetId":{"type":"string"}},"required":["keyCode"],"type":"object"},"name":"key_press","title":"Key Press"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Press a named hardware/system button: home, back, recents, power, volume_up, volume_down, menu, enter, camera.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"button":{"enum":["home","back","recents","power","volume_up","volume_down","menu","enter","camera"],"type":"string"},"targetId":{"type":"string"}},"required":["button"],"type":"object"},"name":"button","title":"Hardware Button"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Named system gesture presets: expand_notifications, expand_quick_settings, collapse_statusbar (all via `cmd statusbar`, no coordinates needed), swipe_up_from_bottom (home/app-switcher gesture-nav swipe), swipe_down_from_top (notification-shade swipe as an alternative to expand_notifications on older API levels).","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"preset":{"enum":["expand_notifications","expand_quick_settings","collapse_statusbar","swipe_up_from_bottom","swipe_down_from_top"],"type":"string"},"targetId":{"type":"string"}},"required":["preset"],"type":"object"},"name":"gesture","title":"Gesture Preset"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Capture the current screen, return it as an image, and save a copy under .androidmcp-framework/artifacts/screenshots/ by default.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"outputPath":{"description":"Optional explicit screenshot file path. Defaults to the project artifacts folder.","type":"string"},"projectPath":{"description":"Project root for the saved screenshot; defaults to the current working directory.","type":"string"},"targetId":{"type":"string"}},"type":"object"},"name":"screenshot","title":"Screenshot"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":true},"description":"Poll the UI until a condition holds, then record the latest snapshot (same caching as snapshot_ui - refs from the result are usable directly). With textContains/resourceId: waits for a matching element to appear (or disappear, if gone:true). With neither: waits for the hierarchy to stop changing between polls (\"settled\").","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"gone":{"description":"Wait for absence instead of presence. Default false.","type":"boolean"},"pollIntervalMs":{"description":"Default 500.","type":"number"},"resourceId":{"type":"string"},"targetId":{"type":"string"},"textContains":{"type":"string"},"timeoutMs":{"description":"Default 10000.","type":"number"}},"type":"object"},"name":"wait_for_ui","title":"Wait For UI"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Run several same-screen UI actions in one call, resolving the target once and reusing it for every step. Use for multiple taps/toggles with no intermediate assertion needed - if you need to check state between steps, call the individual tools instead so you can inspect each result.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"steps":{"items":{"additionalProperties":false,"properties":{"action":{"enum":["tap","long_press","swipe","type_text","key_press"],"type":"string"},"durationMs":{"type":"number"},"elementRef":{"type":"string"},"endX":{"type":"number"},"endY":{"type":"number"},"keyCode":{"type":"string"},"startX":{"type":"number"},"startY":{"type":"number"},"text":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"}},"required":["action"],"type":"object"},"minItems":1,"type":"array"},"targetId":{"type":"string"}},"required":["steps"],"type":"object"},"name":"batch","title":"Batch"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Send a raw touch event (adb shell input motionevent) rather than a full tap/swipe gesture. Use for composing custom multi-point sequences - e.g. DOWN, several MOVEs, then UP - that the higher-level tap/swipe/drag tools don't expose.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"action":{"enum":["down","up","move"],"type":"string"},"targetId":{"type":"string"},"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y","action"],"type":"object"},"name":"touch","title":"Touch (raw down/up/move)"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":true},"description":"Show the active session-default profile and its resolved values (config.yaml sessionDefaults, overlaid with any runtime overrides from session_set_defaults). Call this before your first build/run/test call in a session - do not assume defaults are configured.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"session_show_defaults","title":"Show Session Defaults"},{"annotations":{"destructiveHint":false,"idempotentHint":false,"openWorldHint":false,"readOnlyHint":false},"description":"Set one or more session defaults for the active profile at runtime (in-memory + persisted under the state dir for this profile - not written back to config.yaml). Only the fields you pass are changed; everything else stays as-is.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"applicationId":{"type":"string"},"avdName":{"type":"string"},"gradleTaskPrefix":{"type":"string"},"module":{"type":"string"},"projectPath":{"type":"string"},"targetId":{"type":"string"},"variant":{"type":"string"}},"type":"object"},"name":"session_set_defaults","title":"Set Session Defaults"},{"annotations":{"destructiveHint":true,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false},"description":"Clear runtime overrides for the active profile (or a named one) - falls back to config.yaml's static sessionDefaults on the next read, not to nothing.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"profile":{"type":"string"}},"type":"object"},"name":"session_clear_defaults","title":"Clear Session Defaults"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false},"description":"Switch the active session-defaults profile - useful in a monorepo with several Gradle projects, so each can keep its own remembered projectPath/module/variant/targetId without overwriting the others.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"profile":{"type":"string"}},"required":["profile"],"type":"object"},"name":"session_use_defaults_profile","title":"Switch Session Defaults Profile"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":true,"readOnlyHint":true},"description":"Check Android development prerequisites: adb, Java, Gradle, Android SDK, emulator, build-tools and the optional Google Android CLI integration. This framework does not require Python.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"doctor","title":"Doctor"},{"annotations":{"destructiveHint":false,"idempotentHint":true,"openWorldHint":false,"readOnlyHint":false},"description":"List every workflow and which of its tools are currently enabled, or enable/disable a workflow for this running server session. Session-only - it does not edit .android-build-mcp/config.yaml, so restart-persistent changes still belong in enabledWorkflows there.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"action":{"description":"Default \"list\".","enum":["list","enable","disable"],"type":"string"},"workflowName":{"description":"Required for enable/disable.","type":"string"}},"type":"object"},"name":"manage_workflows","title":"Manage Workflows"}]}}}
