Skip to main content
Glama

上传并关联应用软件包

agc_update_app_package
Destructive

Upload an app package (APK/AAB/RPK) to the current draft version for HarmonyOS or Android, using a local file path or an already uploaded object ID.

Instructions

上传软件包并写入应用当前草稿版本:HarmonyOS 走 PUT /api/publish/v3/app-package-info(返回 packageId),Android 走 PUT /api/publish/v2/app-file-info(fileType=5,返回 pkgVersion)。可以传本地 filePath(自动上传),也可以传已上传的 objectId + fileName。软件包需异步解析,约 2 分钟后再提交发布,可用 agc_get_package_compile_status 查询。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appIdYes
fileNameNo文件名(含后缀);使用 objectId 时必填
filePathNo本地软件包路径(.app / .apk / .aab / .rpk)
objectIdNo已上传文件的 objectId(与 filePath 二选一)
platformYes应用平台:harmonyos = HarmonyOS 5 及以上应用/元服务(v3 接口);android = Android 及 HarmonyOS 4 及以下(v2 接口)
releaseTypeNoAndroid:1 全网(默认)/ 3 分阶段
releasePhaseNoHarmonyOS:0 全网(默认)/ 3 分阶段
chineseMainlandFlagNo软件包是否分发中国大陆,注册地非中国大陆时必填

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, and the description aligns by stating it writes to the draft version. It adds valuable behavioral context: the operation is asynchronous, requires a ~2-minute wait, and returns a packageId or pkgVersion. This goes beyond the annotations, which only signal danger, not the async nature or the need to poll the compile status.

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 description is a single dense sentence that front-loads the core purpose and packs in essential details (platform differences, input modes, async wait, sibling tool). While efficient and free of fluff, it could be more scannable if split into bullet points or short paragraphs. Still, every clause carries information.

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?

Given the tool's complexity (8 parameters, two platforms, two input modes, async behavior) and lack of an output schema, the description covers the key operational aspects: how to provide the file, what each platform returns, and the follow-up action (check compile status). It doesn't detail error scenarios or prerequisites like having a draft version, but it provides enough for correct invocation.

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 88%, so most parameters are already documented. The description adds meaningful context for the filePath vs objectId relationship (mutually exclusive alternatives) and clarifies platform-specific behavior (which API each uses). It also hints at the releaseType/releasePhase defaults, though those are in the schema. Overall, it adds value beyond the schema without redundancy.

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 clearly states the tool's purpose: upload a software package and associate it with the current draft version of the app. It specifies the resource (app package), the action (upload and write), and distinguishes between HarmonyOS and Android paths with distinct API endpoints. This differentiates it from siblings like agc_upload_file (which only uploads) and agc_submit_app (which submits for release).

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?

The description explains the two input modes (filePath for direct upload, objectId+fileName for already-uploaded files) and instructs to wait ~2 minutes before publishing, pointing to agc_get_package_compile_status for status checks. It doesn't explicitly state when to use alternative tools, but the context makes it clear this tool handles both upload and association, and it references a sibling for follow-up. Some explicit 'when not to use' guidance would push it to 5.

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