Tool Name: Not defined in the current tool contract
Risk Level: High-Risk
Execution Mode: Asynchronous submission with an optional confirmation gate
Category: Device Management
Quick Start (Copy & Use)
Summary: Submit one application uninstall task for 1-100 devices that all use the same Platform.
Prerequisites: DeviceIds, the installed application's PkgId, and Platform. The default RequireConfirmation=true opens a confirmation form that requires a Reason; set it to false only when explicit approval was already obtained outside this tool.
Success Criteria: StatusCode == 200, ErrorMessage is empty, and HistoryId is positive. This means the task was accepted; it does not mean every device has completed the uninstall.
What to Do Next: Query Get Application Uninstall Result with HistoryId for per-device completion.
Minimal Request Example:
{
"DeviceIds": ["a8f3d91c72b44e5fa103c892d0b74561"],
"PkgId": "com.contoso.warehouse",
"Platform": "Android",
"AppName": "Contoso Warehouse",
"RequireConfirmation": true
}
Minimal Response Example:
{
"HistoryId": 710245,
"Hint": "",
"Retryable": false,
"OriginalStatusCode": 200,
"StatusCode": 200,
"ErrorMessage": ""
}
Recipes (Common Recipes)
Recipe 1: Uninstall from One Android Device
When to use: The package and device ID have already been verified.
{
"DeviceIds": ["a8f3d91c72b44e5fa103c892d0b74561"],
"PkgId": "com.contoso.warehouse",
"Platform": "Android",
"RequireConfirmation": true
}
Recipe 2: Submit a Pre-Approved Windows Task
When to use: Explicit approval was recorded outside the workflow.
{
"DeviceIds": ["4c7e2a90f15d438bb617e9206ab34fd8"],
"PkgId": "Contoso.Warehouse_2.4.0.0_x64__8wekyb3d8bbwe",
"Platform": "Windows",
"AppName": "Contoso Warehouse",
"RequireConfirmation": false
}
RequireConfirmation=false skips the form and records Confirmation skipped by RequireConfirmation=false. as the audit reason.
Recipe 3: Track the Accepted Task
When to use: A submit response contains a positive HistoryId.
{
"HistoryId": 710245,
"PageIndex": 1,
"PageSize": 20
}
Use Get Application Uninstall Result; do not infer device completion from the submit response.
1. Overview
1.1 Description
Starts an uninstall task for one package on selected devices. The submit response returns a task receipt, not per-device results.
1.2 When to Use
- Remove a known user-installed application from selected devices.
- Start a task that must be audited with an application display name.
1.3 Execution Mode and Response
The task submission is asynchronous. A positive HistoryId with an empty ErrorMessage means acceptance only. Use Get Application Uninstall Result to inspect Processing, Success, or Failed for each device.
1.4 Prerequisites
| Condition | Description |
|---|---|
| Valid device targets | DeviceIds contains 1-100 distinct non-blank IDs, all matching Platform. |
| Installed application | Obtain PkgId from the installed-app information for the selected devices. |
| Confirmation | Default confirmation requires a form Reason; bypass only with prior explicit approval. |
1.5 Prerequisite Tools
| Tool | Purpose |
|---|---|
| List Device Apps | Find installed applications and their PkgId. |
| Get a Device App by Name | Find one installed application by its exact name. |
1.6 Similar Tools
Use Get Application Uninstall Result to read an existing task, not to submit another uninstall.
2. Inputs
2.1 Parameter List
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| DeviceIds | string-array | Yes | - | 1-100 distinct non-blank device IDs. |
| PkgId | string | Yes | - | Non-blank package ID, at most 255 characters. |
| Platform | string | Yes | - | Android or Windows; capitalization variants are normalized. |
| AppName | string | No | "" | Audit display name, at most 255 characters. |
| RequireConfirmation | bool | No | true | Whether to open the manual confirmation flow. |
2.2 Parameter Details
`DeviceIds`
Obtain IDs from device lookup. Every entry must be a non-blank string, duplicates are rejected, and all targets must use the selected Platform.
`PkgId`
Use the package ID from List Device Apps or Get a Device App by Name. Built-in management packages, including com.sand.airdroidbiz, are rejected. System applications can also be rejected by the service.
`Platform`
The only accepted values are Android and Windows. Select one shared platform for every DeviceIds entry.
`RequireConfirmation`
With true, the workflow waits for the confirmation form and its required Reason. With false, the form is skipped and the workflow uses its fixed recorded reason.
2.3 Parameter Combination Logic
- DeviceIds, PkgId, and Platform are required.
- AppName may be blank.
- The form Reason is not a Start-node input; it is collected only on the RequireConfirmation=true path.
3. Outputs
3.1 Response Examples
Accepted task: See Quick Start.
Validation failure:
{
"HistoryId": 0,
"Hint": "Set Platform to Android or Windows, then retry.",
"Retryable": false,
"OriginalStatusCode": 0,
"StatusCode": -1,
"ErrorMessage": "Platform must be Android or Windows."
}
3.2 Field Descriptions
| Field | Type | Description |
|---|---|---|
| HistoryId | number | Positive accepted-task ID; use it for per-device results. |
| StatusCode | number | 200 finished the submit step; -1 validation failed; -2 was rejected before an upstream call; -3 confirmation timed out; 500 is a system or network error. |
| ErrorMessage | string | Empty means task acceptance only; non-empty means submission failed. |
| Hint | string | Recommended next action after a failure. |
| Retryable | bool | Whether the identical request may be attempted again after failure. |
| OriginalStatusCode | number | Upstream HTTP status; 0 means no response, -2 rejection before upstream, and -3 confirmation timeout before upstream. |
3.3 Status Values
HistoryId is not a device status. Per-device values are available only in the result tool as Processing, Success, or Failed.
4. Examples
4.1 Protected Management Package
Submitting PkgId com.sand.airdroidbiz returns StatusCode -1; do not replace it with a retry.
4.2 Canceled or Timed-Out Confirmation
When confirmation does not reach the code step, StatusCode is -2 for rejection or -3 for timeout. Neither outcome creates an uninstall task.
4.3 Mixed Platform Targets
Do not submit Android and Windows IDs together. Split them by Platform into separate tasks.
5. Error Handling
5.1 StatusCode Semantics
| StatusCode | Agent action |
|---|---|
| -1 | Correct inputs; do not retry unchanged. |
| -2 / -3 | No upstream task was submitted; obtain approval before starting another flow. |
| 200 with non-empty ErrorMessage | Follow Hint; task acceptance did not occur. |
| 500 | Read Hint, Retryable, and OriginalStatusCode; verify task/device state before retrying a write. |
5.2 Common Errors
| ErrorMessage | Resolution |
|---|---|
| DeviceIds must contain 1-100 IDs. | Provide 1-100 distinct IDs. |
| PkgId must be a non-blank string up to 255 characters. | Use the installed application's package ID. |
| Reason must be a non-blank string up to 500 characters. | Provide a form reason on the confirmation path. |
5.3 Retry Decision
This is a write. It is not idempotent; after an uncertain result, verify the task and device state before repeating it.
6. Best Practices
6.1 Security
Confirm the package, platform, and targets before approving. Removing the management daemon would prevent remote management and is blocked.
6.2 Idempotency
Not idempotent. Do not repeat a successful submission, and do not blindly repeat an uncertain submission.
7. Related Tools
| Tool | Role |
|---|---|
| List Device Apps | Obtain installed-app PkgId values. |
| Get a Device App by Name | Look up one installed application. |
| Get Application Uninstall Result | Read per-device progress using HistoryId. |
8. Tool Chains
8.1 Verify, Submit, and Track
List Device Apps -> Uninstall Application -> Get Application Uninstall Result
Use the returned HistoryId in the final step and wait for per-device statuses rather than treating task acceptance as completion.
Leave a Reply.