Skip to main content
Glama

restart-app

Terminate and relaunch an iOS, Android, or Vega app to reset in-memory state without reinstalling, and refresh native-devtools injection on supported Apple targets.

Instructions

Terminate then relaunch an app on iOS, Android, or Vega. Use when you need a clean in-memory state without a full reinstall. The relaunch also refreshes the native-devtools injection (iOS and Apple TV). Returns { restarted, bundleId, networkCapture? }. If Argent started native capture, networkCapture reports whether it followed the launch or was stopped. This note applies to Android and local iOS simulators. Fails if the app is not installed, on a local iOS simulator if terminating it does not finish within 15s, or on a remote simulator if terminating it fails for a reason other than the app not running.

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": {
      "udid": "<udid>",
      "bundleId": "<bundleId>"
    },
    "name": "restart-app"
  }
}

Input Schema

NameRequiredDescriptionDefault
udidYesTarget device id from `list-devices` (iOS UDID or Android serial).
activityNoAndroid-only: relaunch a non-launcher Activity (e.g. `.SettingsActivity` or `com.example/com.example.SettingsActivity`). If omitted, the app's default launcher activity is used.
bundleIdYesApp identifier. iOS: bundle id. Android: package name. Vega: interactive component app id.
launchArgsNoApple simulators and physical iPhones: arguments passed to the app process at launch, e.g. `["-FeatureFlag", "YES"]` to override UserDefaults.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / activity / description
      Previous value: -"Android-only: relaunch a non-launcher Activity (e.g. `.SettingsActivity` or `com.example/com.example.SettingsActivity`). If omitted, the app's default launcher activity is used. Ignored on iOS."New value: +"Android-only: relaunch a non-launcher Activity (e.g. `.SettingsActivity` or `com.example/com.example.SettingsActivity`). If omitted, the app's default launcher activity is used."
    • changedInput schema / properties / bundleId / description
      Previous value: -"App identifier. iOS: bundle id. Android: package name."New value: +"App identifier. iOS: bundle id. Android: package name. Vega: interactive component app id."
    • addedInput schema / properties / launchArgs
      Added value: +{
      +  "description": "Apple simulators and physical iPhones: arguments passed to the app process at launch, e.g. `[\"-FeatureFlag\", \"YES\"]` to override UserDefaults.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. Changed1 schema field changedv0.25.1
    • changedInput schema / properties / bundleId / pattern
      Previous value: -"^[A-Za-z_][A-Za-z0-9._-]*$"New value: +"^[A-Za-z0-9_][A-Za-z0-9._-]*$"
  3. First observedv0.15.0

TDQS

A4.3/5.0
Behavior5/5

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

With no annotations at all, the description carries the full burden and does so: it discloses the terminate-then-relaunch sequence, the native-devtools injection refresh (iOS/Apple TV), the return shape, the conditional networkCapture field and its platform scope (Android and local iOS simulators), and three distinct failure modes including a 15s termination timeout. This is unusually rich disclosure for an unannotated mutation tool.

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

Conciseness5/5

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

Structure is strongly front-loaded: purpose first, then the when-to-use condition, then return contract, then failure modes. Every sentence carries distinct information, and the long failure-mode sentence earns its length by enumerating three separate error conditions.

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 destructive-in-effect process tool with no annotations and no output schema, the description covers what it does to the app, what it returns (including the optional networkCapture field), platform-specific side effects, and the failure envelope. An agent has enough to decide to call it and to interpret both success and error outcomes.

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 udid, bundleId, activity and launchArgs are already well documented in the schema. The description adds only platform-level context (which platforms honor native capture) and repeats bundleId via the return object, without adding syntax or format meaning beyond the schema. Baseline 3 applies.

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

Purpose4/5

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

The opening sentence gives a precise compound verb ('Terminate then relaunch') plus the resource ('an app') and the supported platforms (iOS, Android, Vega). The clause 'without a full reinstall' implicitly contrasts it with reinstall-app, but the nearest sibling, launch-app, is never named, so the agent must infer the relaunch-vs-launch distinction.

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?

It states a clear selection condition: 'Use when you need a clean in-memory state without a full reinstall.' That tells the agent the scenario and rules out the reinstall path. What's missing is an explicit pointer to the alternative tools (launch-app for a cold start on an already-stopped app, reinstall-app by name) when this condition does not hold.

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