Skip to main content
Glama

aua_hot_swap

Push code and resource edits into a running debuggable Android app without reinstalling or restarting, compiling changed classes in place and falling back to a full build when needed.

Instructions

For developing an Android app whose source is on this computer: after editing its code or resources, push the edits into the running debuggable app in about a second, without reinstalling or restarting it. project is the absolute path of a Gradle root or module directory (auto-detected; settings go to build/, project files stay untouched), or of a directory with a hotswap.json. action=swap (default) compiles what changed and redefines the classes in place; Compose recomposes with remembered state, View screens are rebuilt with scroll position and input text kept. It falls back to a full build, install and launch when needed (first call, app not running, manifest/build file change, refused swap): result is swapped, installed or unchanged, with reason for a fallback. The first call can take minutes (Gradle). action=build forces the full build; action=status reports the host toolchain, pending edits and what the next swap would do, changing nothing. A compile error returns compile_failed with compiler output and leaves the app as it was: fix the source and call again. observe returns the screen after the swap in the same call; verified=false: check the UI yourself. Needs a JDK and the Android SDK (NDK once per device ABI). Debuggable builds only; module/variant default to :app/Debug.

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": {
      "project": "<project>"
    },
    "name": "aua_hot_swap"
  }
}

Input Schema

NameRequiredDescriptionDefault
actionNoswap
moduleNo
observeNonone
projectYes
refreshNoauto
variantNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.8.0

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare readOnlyHint=false, openWorldHint=true, idempotentHint=false; the description goes well past that with the fallback-to-full-build conditions, the possible result values (swapped/installed/unchanged) with reasons, the minutes-long first call from Gradle, and compile_failed leaving the app untouched. The one thing not disclosed is what 'refresh' actually changes in behavior, which for a state-preserving tool matters.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the one-sentence purpose, then dependencies, then failure semantics; nearly every clause adds information an agent would otherwise have to discover. It is dense and occasionally run-on, but there is little restatement of the tool name or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a six-parameter, no-output-schema tool that mutates a live app, the description covers outcomes, fallback reasons, compile failures, toolchain requirements, and the observe-in-same-call contract. Only the refresh parameter's effect and the concrete meaning of observe's tree/screenshot/both values are left unstated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description has to carry the parameters, and it does for most: project (absolute path, Gradle root or module, auto-detection, settings redirected to build/, hotswap.json alternative), action (all three modes given concrete semantics), module/variant defaulting to :app/Debug, and observe described by effect rather than enum. The refresh enum (auto/recreate/none) is never explained despite directly controlling whether state is kept, leaving one parameter undocumented in both places.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: push edited code/resources into the running debuggable Android app without reinstall or restart, with the project directory as the anchor. The 'about a second' framing and the swap/build/status action split make it unmistakable against siblings like aua_launch_app or aua_observe.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit preconditions ('source is on this computer', 'after editing its code or resources', 'debuggable builds only') and explicit routing between modes: swap is the default, action=build forces the full path, action=status changes nothing. It also points out that observe can return the screen in the same call, which is exactly the alternative an agent would otherwise reach for a separate observe tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.