Skip to main content
Glama

Trace focused package/activity per display (blocking)

mobile_focus_trace

Captures the focused Android package, activity, and taskId for a fixed duration to show which app or screen is active; large runs save full samples to an artifact.

Instructions

Blocking sample of focused package/activity/taskId for a fixed duration. Prefer mobile_focus_trace_start/stop when interleaving input or recording. Large sample sets are written to an artifact; only a compact prefix is inlined.

Input Schema

NameRequiredDescriptionDefault
serialYesExact ADB serial from mobile_devices_list; never inferred when multiple devices exist
displayIdsYes
durationMsYes
maxSamplesNo
sampleIntervalMsNo
includeAllSamplesNo

Output Schema

NameRequiredDescriptionDefault
serialYes
changesYes
samplesYes
truncatedYes
displayIdsYes
durationMsYes
changeCountYes
sampleCountYes
startedAtIsoYes
stoppedAtIsoYes
boundRecordIdNo
droppedSamplesYes
focusSessionIdYes
sampleIntervalMsYes
responseCompactedNo
samplesArtifactUriNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.9.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. First observedv0.5.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations are weak here (readOnlyHint=false, idempotentHint=false, destructiveHint=false) and say nothing about the blocking nature or where output lands, so the description carries real value: it discloses that the call blocks and that large sample sets go to an artifact with only a compact prefix inlined. Missing dependency/permission requirements (e.g. root) and timeout risk, keeping it below 5.

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?

Three tight sentences: purpose first, routing second, output behavior last. No filler, and the most decision-relevant information is front-loaded.

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?

An output schema exists, so return values need no explanation, and the description covers the blocking contract and artifact behavior. It stops short of covering prerequisites (root/permissions) and failure modes, which matters for a blocking call that can run up to 180s.

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 only 17% — serial and the displayIds item type are documented, but durationMs, maxSamples, sampleIntervalMs, and includeAllSamples have no schema descriptions. The description hints at duration and sampling volume (large sets to artifact, compact prefix inlined) but does not explain interval, cap, or includeAllSamples semantics, so it only partially compensates.

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 (blocking sample), resource (focused package/activity/taskId), and scope (fixed duration), and explicitly distinguishes itself from the mobile_focus_trace_start/stop siblings. An agent can select it without opening the 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?

Names the alternative (mobile_focus_trace_start/stop) and the condition that selects it (interleaving input or recording), which is solid routing guidance. It doesn't spell out when-not beyond that single case, but the key decision point is covered.

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