Skip to main content
Glama

check_focus_order

Press Tab or a key until focus cycles to map keyboard focus order, list every stop, unreached controls, and whether focus loops, gets stuck, or is lost.

Instructions

Check the keyboard focus order in one call: press Tab, or key, until the focus comes back round, and list where it went, a tree line each, after a "began in" line. Then the controls the key never reached, and how it ended: round again (fine), stuck (a trap, or a text view nothing leaves), not round after most presses, lost (no node has the focus), stopped (a text view closed as it was left), or nothing focused to begin with (click the window with click_element first). With visible, "focus not shown on N" counts stops that don't show it. A text view that takes Tab is left as a person would, with ctrl+Tab, shift+Tab, Escape or F6. The focus stays where it ended. To press a few keys yourself, use press_keys.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyNoThe chord to press (Tab)
mostNoPresses at most (50)
ignoreNoRegexes for unreached controls to leave out
windowNoA window's title, exactly or a regex matched in full, or app=RE for its app id
sessionYesIts name, from start_session
visibleNoAlso check each place it lands shows it has the focus

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.8.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false and destructiveHint=false, which is ambiguous about side effects; the description resolves this by disclosing that keys are actually pressed and 'the focus stays where it ended'. It also enumerates the possible termination outcomes (round, stuck, lost, stopped, etc.), which is real behavioral context beyond the annotations. No contradiction: pressing keys that move focus is consistent with readOnlyHint=false.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

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

The content largely earns its place given the tool's complexity, and the core action is front-loaded, but it is delivered as one sprawling run-on sentence with nested parentheticals and a long inline enum of ending states, making it hard to parse. It is dense rather than wasteful, but the structure is poor.

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 6-parameter tool with no output schema and no nested objects, the description covers what it does, the shape of the output (a 'began in' line then one tree line per stop), the terminating states, and the visible behavior. Return format is partially carried by the description since no output schema exists; it is largely complete for an agent to call correctly.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds semantics the schema does not: it explains what 'visible' does (the 'focus not shown on N' count), how the default key (Tab) drives the traversal, and how the run ends ('until the focus comes back round'). That goes beyond the terse schema strings.

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 and resource (check the keyboard focus order) and concretely describes the outcome: press Tab until focus cycles, list where it went as a tree, plus unreached controls and the ending state. It distinguishes itself from the sibling it names, press_keys, so an agent can tell the two apart without reading 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?

Routes the agent to press_keys for typing a few keys manually, and gives the prerequisite that if nothing is focused the agent must click the window with click_element first. It doesn't state explicit exclusions ('don't use this when...'), but the alternative and precondition cover the main decision points.

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