Skip to main content
Glama

get_foreground_app

Read-only

Identify which app is currently in the foreground on a selected device, so you can verify active context. Returns unknown when the backend cannot observe the foreground app.

Instructions

Identify the app currently in front on the selected device. The result reports unknown if the backend cannot observe it.

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": "get_foreground_app"
  }
}

Input Schema

NameRequiredDescriptionDefault
device_idNo
timeout_msNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, openWorldHint=true, and idempotentHint=false. The description adds genuinely useful context beyond them: the result may report "unknown" when the backend cannot observe the foreground state, which warns the agent not to treat a null result as an error. It does not cover timeout behavior or what the return payload 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.

Conciseness5/5

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

Two short sentences, zero padding, with the core purpose front-loaded and the caveat about "unknown" following immediately. Every sentence earns its place.

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 read tool with annotations covering the safety profile, the main missing pieces are the default-device behavior and the timeout_ms meaning, both of which matter because neither parameter is required or documented. The output-schema gap is partly offset by the note about the "unknown" result, but the definition is only marginally complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%: neither device_id nor timeout_ms is described in the schema, and the description only obliquely references "the selected device" without explaining how a device is selected or what happens when device_id is omitted (both parameters are optional). timeout_ms semantics are entirely absent, so the description fails to compensate for the coverage gap.

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?

"Identify the app currently in front on the selected device" gives a specific verb (identify) and a specific resource (foreground app), which is clearly distinct from siblings like list_apps or get_device_info. It stops short of explicitly naming an alternative, so it is clear but not sibling-differentiated by name.

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?

The description says nothing about when to prefer this over list_apps or get_device_info, nor when the foreground check is appropriate (e.g., after launch_app to confirm foregrounding). No exclusions or prerequisites are given, leaving usage to inference.

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