Skip to main content
Glama

ax_focus

Focus a control by matching its accessibility role or label in the background via macOS Accessibility or Windows UI Automation, without moving the cursor. Ambiguous substring matches fail closed.

Instructions

Legacy query action that focuses a control through macOS Accessibility or Windows UI Automation. Background, no cursor. Ambiguous substring matches fail closed; prefer a fresh ax_read node whenever possible.

Input Schema

NameRequiredDescriptionDefault
queryYesCase-insensitive substring matching the target element's accessibility role or label/title (e.g. "Send", "Search", "AXButton").

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.0
    • removedInput schema / title
      Removed value: -"AxQueryParams"
  2. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full behavioral burden, and it does disclose non-obvious traits: background execution, no cursor movement, and fail-closed behavior on ambiguous matches. It omits permission/accessibility-authorization requirements and what a successful call returns.

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?

Three tight clauses, front-loaded with what the tool does, then side-effect profile, then the alternative recommendation. No filler, though 'Legacy' is somewhat imprecise about what it supersedes.

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 one-parameter tool with no output schema and no annotations, the description covers action, side effects, and failure mode adequately but leaves the return value and authorization/permission needs unspecified — the latter being genuinely relevant for OS accessibility APIs.

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 100%, so the single 'query' parameter is already fully documented as a case-insensitive substring. The description's 'ambiguous substring matches fail closed' adds a small amount of resolution semantics beyond the schema, but the baseline of 3 is appropriate.

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?

States a specific verb and resource (focuses a control) plus the platform mechanism (macOS Accessibility / Windows UI Automation). The word 'Legacy' and the pointer to ax_read differentiate it from sibling focus/activate tools, though it doesn't explicitly compare against ax_activate or ax_click.

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?

Gives a clear routing rule — 'prefer a fresh ax_read node whenever possible' — which steers the agent toward an alternative, and 'Legacy' implies a fallback status. It stops short of stating explicit preconditions (e.g., when focusing is actually required vs. activating).

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