Skip to main content
Glama

App state

app_state
Read-only

Reports whether an app is installed, running, or foreground, plus PID, uptime, and Metro bundle source. Pass source_path to detect a stale dev server from the wrong checkout.

Instructions

Report an app's RUNTIME state: installed?, running?, foreground?, top activity, pid(s), main-process uptime, install/update times, and — for React Native/Expo — whether it is serving a live METRO bundle or its baked-in EMBEDDED one. When it is on Metro it also identifies WHICH dev server: port, pid, and the project root that server is running in. That matters because "metro" does not mean the RIGHT metro — a dev server left running from another checkout still holds port 8081, so the app connects happily and runs that branch's code while this call looks healthy. Pass source_path to get an explicit stale_verdict (stale | current | undetermined) with its reason, never silence. Run this FIRST when JS edits seem to have no effect.

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": {
      "package": "<package>"
    },
    "name": "app_state"
  }
}

Input Schema

NameRequiredDescriptionDefault
serialNoTarget device serial (adb -s). Optional when exactly one device is attached.
packageYesApplication package name.
source_pathNoOptional host file or directory containing the app's source. When supplied, app_state ALWAYS returns a stale_verdict (stale | current | undetermined) with the reason — it compares the newest source mtime against the latest Metro/HMR marker, and checks that the dev server the app is connected to is rooted in this same checkout.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.23.0
    • changedInput schema / properties / source_path / description
      Previous value: -"Optional host file or directory containing the app's source. When supplied, app_state compares its newest mtime with the latest Metro/HMR marker to flag stale JavaScript."New value: +"Optional host file or directory containing the app's source. When supplied, app_state ALWAYS returns a stale_verdict (stale | current | undetermined) with the reason — it compares the newest source mtime against the latest Metro/HMR marker, and checks that the dev server the app is connected to is rooted in this same checkout."
  2. First observedv1.0.0

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, consistent with a pure reporting tool, and the description adds genuine behavioral context: the stale_verdict is always returned ("never silence") when source_path is given, and it explains the failure mode where a stale Metro on port 8081 makes the app look healthy. That said, it does not disclose cost, latency, or side effects of the probe itself.

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 core claim is front-loaded and the escalation to source_path/stale_verdict follows logically; every sentence is doing work. It loses a point for rhetorical padding ("'metro' does not mean the RIGHT metro") and for restating the stale|current|undetermined enum that the schema already declares.

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 carries the return-value burden and does so by listing the concrete state fields and the stale_verdict outcome with its cause. For a read-only three-parameter diagnostic, nothing an agent needs in order to decide or call is missing.

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 coverage is 100%, so all three parameters are already documented, including source_path's mtime-vs-HMR comparison and enum values. The description adds rationale (why source_path matters, what a wrong-Metro checkout looks like) rather than new parameter meaning, so the baseline 3 is appropriate.

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 ("Report") and resource ("an app's RUNTIME state") and then enumerates the exact fields returned: installed/running/foreground, top activity, pids, uptime, install/update times, Metro vs embedded bundle, and the dev-server port/pid/root. The emphasis on RUNTIME implicitly separates it from static siblings like get_app_details or list_packages, so an agent can pick it without opening a 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?

Gives an explicit trigger: "Run this FIRST when JS edits seem to have no effect," plus a conditional workflow (pass source_path to force a stale_verdict). It does not explicitly contrast with sibling diagnostics such as build_status, get_app_details, or reload_app, so the agent must infer those boundaries.

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