Skip to main content
Glama
mcp-server-macos

mcp-server-macos

Focus an element

focus_ui_element

Brings the element's app to the front and gives it keyboard focus so type_text and press_keys target it.

Instructions

Bring an element's app to the front and give it the keyboard focus, for type_text or press_keys to go to it.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "id": "<id>"
    },
    "name": "focus_ui_element"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesThe element's id, from get_ui_elements, find_ui_elements or another tool of these that returned it.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.2

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare the safety profile (non-read-only, non-destructive, not idempotent, closed-world), and the description usefully adds that it raises the element's app window, a side effect not visible in annotations. It does not cover what happens if the element is gone, unfocusable, or behind a modal, which matters for a focus-stealing operation.

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?

A single sentence with the action front-loaded and the rationale trailing, with no redundant restatement of the title or schema.

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 one-parameter tool with an output schema, the description covers what it does and why an agent would call it. Failure modes (element not found, app not focusable) are the only material gap.

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% and the single 'id' parameter already documents its type and provenance (from get_ui_elements, find_ui_elements). The description contributes no additional meaning about the id, so baseline 3 applies.

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 concrete verb+resource ('Bring an element's app to the front and give it the keyboard focus') and ties it to a downstream purpose (so type_text or press_keys target it). This is clearly differentiable from siblings like click_ui_element or press_ui_element, which act rather than focus.

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?

The clause 'for type_text or press_keys to go to it' tells the agent the condition that selects this tool: pre-focusing before keyboard input. It does not name an alternative or state when not to use it, but the usage context is clear without inference.

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