Skip to main content
Glama

ACTION_GET_APP_INFO

Reads the foreground Android app's package name and Activity via accessibility, returning them as workflow variables so automations can branch on the active screen.

Instructions

读取前台应用包名和 Activity(经无障碍)(需无障碍)。输出:current_app, current_activity。无障碍未开时写 unknown;需要 shell 兜底请用 ACTION_FOREGROUND_APP。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。

Input Schema

NameRequiredDescriptionDefault
requireNo执行后要求为 true 的变量名(如 click_success),不满足按出错处理
on_errorNo节点出错时:skip=跳过继续(默认),stop=停止整个工作流
output_varNo包名存到的变量名(默认 current_app)
activity_varNoActivity 类名存到的变量名(默认 current_activity)
node_timeout_msNo单节点超时毫秒,0=不限;默认 30 分钟

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden, and it discloses the key traits: accessibility dependency, the 'unknown' fallback value, ${var} interpolation in string params, and JSON variable-snapshot output. It doesn't cover latency, extra permissions, or whether reading is side-effect free, which keeps it below a 5.

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 purpose and the accessibility requirement come first, followed by output and fallback guidance, which is a sensible order. There is minor redundancy in listing the output variable names already covered by the schema, and a stray double punctuation mark ('。。'), but no real padding.

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?

For a five-parameter read tool with no output schema, the description covers the return values, the failure mode, and the alternative tool, and the fully-documented schema handles the rest. Only minor behavioral details such as side-effect freedom are absent.

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 the schema already documents all five parameters including the output_var/activity_var defaults. The description only restates the default output variable names and notes interpolation for string params, adding marginal 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.

Purpose5/5

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

The description opens with a specific verb and resource: reading the foreground app's package name and Activity, and it names the mechanism (accessibility). It also distinguishes itself from the sibling ACTION_FOREGROUND_APP, so an agent can choose between them without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description states the accessibility prerequisite, describes the degradation behavior when accessibility is off, and explicitly routes the agent to ACTION_FOREGROUND_APP when a shell fallback is needed. This gives both the when-to-use and a concrete alternative.

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