Skip to main content
Glama

mumu_foreground

Identifies the app or activity currently in the foreground on a MuMu emulator instance by checking activity records and the focused window to resolve transition mismatches.

Instructions

Which app/activity is in front right now.

Reads dumpsys activity activities and falls back to the focused window; the two disagree during transitions, so both are consulted.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "mumu_foreground"
  }
}

Input Schema

NameRequiredDescriptionDefault
vmindexNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does add real behavioral context: it names the underlying source (dumpsys activity activities) and warns that the fallback focused-window source can disagree during transitions. It does not state whether the call is read-only, whether it requires a running emulator or permissions, or what the returned value looks like.

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 answer is front-loaded in the first sentence, and the implementation detail is compact and tied to why the reading might be ambiguous. The dumpsys mechanism is arguably internals an agent does not need, but it is brief and supports the caveat.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple single-value query with no output schema, the description should say what is returned (package name, activity component, or a formatted string) and does not. The behavioral caveat about transition disagreement is a valuable addition that partly offsets this.

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 0% for the single optional vmindex parameter (default 0), so the description would need to compensate by explaining what target device the index selects. It does not, but the parameter is optional with a default, so an agent can still call the tool correctly without understanding it.

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 description uses a specific query phrase, 'which app/activity is in front right now,' naming the exact resource it reports. It is clearly distinguishable from siblings that enumerate or launch apps, though it never names those siblings explicitly.

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

Usage Guidelines2/5

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

There is no when-to-use guidance, no exclusions, and no reference to alternatives such as app-info or app-list. An agent can infer the use case from the purpose sentence, but nothing steers it away from overlapping tools.

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

Deploy Server

Other Tools