Skip to main content
Glama

Robot Actions — Remote Device Control

Device focus events

device_focus_events
Read-onlyIdempotent

Read recent Android focus-change events from logcat. Useful AFTER a tap on an input field and BEFORE device_type to verify focus actually landed on the expected element — diagnoses the "type went into the wrong field" race that bites parallel tap+type sequences. Filters to ViewRootImpl (window focus), WindowManager (focus transitions), and InputMethodManager (IME show/hide) events. Returns a short summary line followed by the matching logcat lines (newest last). Empty result = no focus events in the recent window, which usually means the tap did NOT change focus (tap missed, or you tapped a non-focusable element).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxNoMax focus events to return (default: 30, capped at 500). Newest last.
udidYesDevice serial number (UDID)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), so the description goes further by disclosing the exact event sources filtered (ViewRootImpl, WindowManager, InputMethodManager), the output shape (summary line plus newest-last logcat lines), and the semantics of an empty result. This is meaningful behavioral context beyond the structured fields.

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?

Front-loaded with purpose, then usage, filters, return format, and empty-result meaning. Every sentence contributes, though the phrasing is dense and slightly verbose in the diagnostic explanation, keeping it just short of maximal conciseness.

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?

For a two-parameter read-only tool with no output schema, the definition covers purpose, timing, filter scope, return format, and empty-result interpretation. An agent has everything needed to invoke it correctly and read its output.

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 both 'udid' and 'max' are already documented. The description only obliquely references the return window ('recent window'), adding no syntax or range detail beyond the schema. Baseline 3 applies when the schema does the heavy lifting.

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 first sentence names a specific verb ('Read') and resource ('recent Android focus-change events from logcat'), immediately distinguishing it from siblings like device_tap and device_type. The scope (logcat focus events) is precise enough that an agent knows exactly what it retrieves.

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?

Explicitly states when to call it ('AFTER a tap on an input field and BEFORE device_type') and why (diagnosing the wrong-field race). It even interprets the negative case — empty result means the tap did not change focus — leaving nothing to inference.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources