Skip to main content
Glama

build_apk

Idempotent

Rebuild an unsigned APK from an apktool-decoded project directory, overwriting any prior build of the same name. Sign the output afterward so it can be installed.

Instructions

Rebuild an APK from an apktool-decoded (and possibly edited) project directory. The result is unsigned, so it won't install until you sign it with sign_apk. Writes to the workspace's apktool/build directory (overwriting a previous build of the same name) and returns { outputPath, signed: false, stdoutTail, stderrTail? }. Fails if inputDir has no apktool.yml, i.e. isn't a decode_apk output. Requires apktool on PATH.

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": {
      "inputDir": "<inputDir>"
    },
    "name": "build_apk"
  }
}

Input Schema

NameRequiredDescriptionDefault
inputDirYesAbsolute path to the decoded project directory - the outputDir returned by decode_apk, possibly edited. Must contain apktool.yml.
workspaceNoWorkspace name (not id). Created if it doesn't exist, and this call is recorded as a job in its history. Defaults to "default".
outputNameNoOutput file name only, not a path (no "/" or ".."). Default "rebuilt.apk".rebuilt.apk

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.3.7
    • changedInput schema / properties / inputDir / description
      Previous value: -"The decoded project directory (from decode_apk), possibly edited"New value: +"Absolute path to the decoded project directory - the outputDir returned by decode_apk, possibly edited. Must contain apktool.yml."
    • addedInput schema / properties / outputName / default
      Added value: +"rebuilt.apk"
    • changedInput schema / properties / outputName / description
      Previous value: -"Output file name, e.g. \"rebuilt.apk\""New value: +"Output file name only, not a path (no \"/\" or \"..\"). Default \"rebuilt.apk\"."
    • 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.4/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing the write target ('workspace's apktool/build directory'), the overwrite of a previous build of the same name, the returned fields ({ outputPath, signed: false, stdoutTail, stderrTail? }), and environmental requirements (apktool on PATH). The overwrite behavior is consistent with idempotentHint=true and destructiveHint=false since it only replaces prior build output.

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?

Three dense sentences with the mechanism, output location, return shape, failure mode, and prerequisite in that order – front-loaded and waste-free. The parenthetical asides make it slightly denser than it needs to be, but nothing is redundant.

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?

For a mutation tool with no output schema, the description compensates fully: it specifies the return shape, unsigned-result caveat, overwrite semantics, failure precondition, and external dependency. No output schema is needed because the return fields are enumerated inline.

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 all three parameters are already documented in the schema; the description adds only marginal meaning, chiefly that inputDir must specifically be a decode_apk output containing apktool.yml. It does not elaborate on outputName/workspace beyond what the schema states, so the baseline of 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?

States a specific verb and resource ('Rebuild an APK from an apktool-decoded ... project directory') and implicitly scopes it against decode_apk (must be a decode_apk output) and sign_apk (result is unsigned). An agent can distinguish it from sibling build/decode/sign tools without opening the schema.

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

Usage Guidelines4/5

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

Clearly frames the workflow position: use it on a decode_apk output directory (possibly edited), and follow with sign_apk before installing. The failure precondition ('Fails if inputDir has no apktool.yml') further routes the agent away from invalid inputs, though no explicitly named alternative for non-apktool projects is given.

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