Skip to main content
Glama

decode_apk

DestructiveIdempotent

Decode an APK's resources to editable XML and disassemble code to smali for editing and rebuilding with build_apk; output replaces the workspace apktool/decode directory.

Instructions

Decode an APK's resources to editable XML and disassemble its code to smali with apktool, so the result can be edited and rebuilt with build_apk (unlike decompile_apk's read-only Java). Always writes to the workspace's single apktool/decode directory and replaces whatever was there, including any edits you made to a previous decode - copy it elsewhere first if you need to keep it. Returns { outputDir, fileCount, files, stdoutTail, stderrTail? }; files holds at most 200 relative paths. Requires apktool on PATH.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
noResNoSkip decoding resources - disassemble smali only. Default false.
noSrcNoSkip disassembling code to smali - decode resources only, which is faster. Default false.
apkPathYesAbsolute path to the file to decode. Must exist; extension must be .apk, .jar or .zip.
workspaceNoWorkspace name (not id). Created if it doesn't exist, and this call is recorded as a job in its history. Defaults to "default".

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.3.7
    • changedInput schema / properties / apkPath / description
      Previous value: -"Absolute path to the .apk file"New value: +"Absolute path to the file to decode. Must exist; extension must be .apk, .jar or .zip."
    • addedInput schema / properties / noRes / default
      Added value: +false
    • changedInput schema / properties / noRes / description
      Previous value: -"Skip decoding resources - smali only"New value: +"Skip decoding resources - disassemble smali only. Default false."
    • addedInput schema / properties / noSrc / default
      Added value: +false
    • changedInput schema / properties / noSrc / description
      Previous value: -"Skip disassembling code - resources only, faster"New value: +"Skip disassembling code to smali - decode resources only, which is faster. Default false."
    • changedInput schema / properties / workspace / description
      Previous value: -"Workspace name (not id) - created automatically if it doesn't exist yet. Defaults to \"default\"."New value: +"Workspace name (not id). Created if it doesn't exist, and this call is recorded as a job in its history. Defaults to \"default\"."
  2. First observedv1.3.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and idempotentHint=true, yet the description adds concrete detail they cannot convey: it always writes to a single apktool/decode directory, overwrites prior edits, advises copying elsewhere to preserve work, and requires apktool on PATH. This is exactly the added context that goes beyond structured hints.

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?

The purpose and its differentiation are front-loaded, and each following sentence carries a distinct load (destructive warning, return shape, dependency). The first sentence is long and load-bearing, but no sentence is wasted.

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

Completeness5/5

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

With no output schema, the description supplies the return shape (outputDir, fileCount, files with a 200-path cap, stdoutTail/stderrTail). Combined with annotations and full schema coverage, an agent has everything needed to invoke it correctly.

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

Parameters3/5

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

Schema description coverage is 100%, so apkPath, noRes, noSrc and workspace are all documented in the schema itself. The description does not add further parameter-level meaning, so the baseline 3 applies.

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?

The description gives a specific verb and resource: decode an APK's resources to editable XML and disassemble its code to smali via apktool. It explicitly distinguishes itself from the sibling decompile_apk by contrasting the editable/rebuildable output against decompile_apk's read-only Java.

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?

It names the complementary tool (build_apk) and the workflow condition that selects this tool — editing and rebuilding. It also names the alternative (decompile_apk) and its read-only nature, so an agent can pick between the two paths without inference.

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