Skip to main content
Glama
mcp-server-macos

mcp-server-macos

Get the focused element

get_focused_ui_element
Read-only

Identifies the UI element currently receiving keystrokes in any app, such as a text field or list, and returns null when no element has focus.

Instructions

Get the element keystrokes go to now (a text field, a list), in whichever app. Null when there's none.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

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

Input Schema

NameRequiredDescriptionDefault

No arguments

Output Schema

NameRequiredDescriptionDefault
elementYesThe element. Null when there's none.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.2

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so safety is covered. The description adds real behavioral context beyond them: it works across whichever app is foreground, and it returns null when no element holds focus — a critical edge case an agent must handle.

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 compact sentence with the core definition front-loaded, followed by clarifying examples and the null case. No filler, no redundant restatement of the title.

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?

With an empty input schema, an output schema present, and annotations covering the safety profile, the remaining burden is scope and edge-case behavior — both are given (cross-app, null when unfocused). Nothing an agent needs in order to call it correctly appears to be missing.

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?

The tool takes zero parameters, so there is no parameter semantics to explain; baseline is 4. Nothing in the description is needed to clarify inputs beyond the empty schema.

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+resource ('get the element keystrokes go to now') and disambiguates what 'focused' means with concrete examples (a text field, a list). It also scopes it cross-app ('in whichever app'), which separates it from coordinate-based siblings like get_ui_element_at, though it never names an alternative explicitly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: an agent can infer this is the tool for locating the current input target before typing or reading. There is no explicit when-to-use/when-not guidance and no mention of alternatives such as get_ui_element_at, find_ui_elements, or read_ui_element_text.

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