Skip to main content
Glama

app_state

Check app runtime state to diagnose ignored JS edits. Reports install/run status, foreground activity, Metro vs embedded bundle, dev server, and stale verdict with source_path.

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.

Input Schema

TableJSON 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.6/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It thoroughly explains what is reported, what happens with Metro vs embedded bundles, the concrete pitfall of a wrong dev server on port 8081, and the guarantee that source_path always yields a stale_verdict with a reason and 'never silence.'

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 longer than average, but every section earns its place: the report contents, the Metro/embedded distinction, the stale-server failure mode, the source_path contract, and the recommended first-use scenario. It is slightly dense and stylistically emphatic, which prevents a 5, but it remains front-loaded with the core purpose.

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?

There is no output schema, so the description must explain return value semantics itself. It does so in detail: runtime states, process details, Metro server identification, and the exact stale_verdict enum with its guarantee of a reason. Given the tool's complexity and lack of annotations, this is a complete and self-sufficient definition.

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 description coverage is 100%, so the baseline is 3. The description adds meaningful semantics for source_path by explaining the mtime comparison and Metro-root check, and clarifies the stale_verdict values. It does not add much beyond the schema for serial and package, but those are already adequately documented and simple.

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 names a specific verb and resource: 'Report an app's RUNTIME state' and then enumerates exactly what that includes (installed, running, foreground, pid, Metro vs embedded, etc.). This clearly separates it from sibling tools like get_app_details or launch_app by focusing on runtime diagnostics rather than metadata or actions.

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 gives explicit actionable guidance: 'Run this FIRST when JS edits seem to have no effect' and tells the caller to pass source_path to obtain a stale_verdict. It does not name specific sibling tools or state when not to use it, but the use case is clearly scoped.

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