Skip to main content
Glama
mcp-server-macos

mcp-server-macos

List what an app shows

get_ui_elements
Read-only

Lists a macOS app's visible UI elements—buttons, text fields, links, menus—with IDs, names, values, and positions so you can inspect and act on them.

Instructions

List what an app shows on screen: its buttons, text fields, links, checkboxes, tabs and menus, each with an id, its name, its value and where it is. Use it to see an app before acting on it, rather than a screenshot: then press_ui_element, set_ui_element_value or click_menu_item with what it gives.

Only what can be seen is listed: the window in front, with the panels over it. When a menu, a dialog or a sheet (a save panel) is open, only it is, as nothing else can be used until it closes. Web pages are read too, in Safari, Chrome and Electron apps. Some apps (games, a few cross-platform ones) show little or nothing this way: take a screenshot then.

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_ui_elements"
  }
}

Input Schema

NameRequiredDescriptionDefault
appNoThe app, by name, bundle identifier or path. The app in front by default.
include_textNoAlso list what's there to be read (text, headings, images), not only the controls.
max_elementsNoThe most elements to list.

Output Schema

NameRequiredDescriptionDefault
appYesThe app's name.
noteNoSomething to know about the list, when there is.
elementsYesTop to bottom, as a person reads the window.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.3.2

TDQS

A4.4/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, and the description adds real behavioral context beyond that: only visible elements of the front window plus overlays are returned, and when a menu, dialog or sheet is open only that surface is listed because nothing else is usable. It also discloses which app families are readable (Safari, Chrome, Electron) and where coverage fails. It stops short of describing pagination/truncation behavior when max_elements caps the result.

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 the core purpose, then usage and fallback, so an agent can stop reading early. It is somewhat long and the element-attribute list partly duplicates what the output schema already conveys, but no sentence is filler and the modal-dialog caveat earns its space.

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 output schema present, the description need not explain return values, and it covers the remaining risk areas: scope (front window and overlays), modal exclusivity, web-page support, and failure modes with a concrete fallback. Nothing an agent needs to call it correctly or interpret an empty result is missing.

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 app, include_text and max_elements are already documented in the schema, and the description does not add syntax, defaults or edge cases for any of them. The statement that 'only what can be seen is listed' loosely implies the include_text distinction, but that is the only marginal contribution. Baseline 3 applies when the schema carries the parameter burden.

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 and resource ('List what an app shows on screen') and enumerates the returned element kinds (buttons, text fields, links, checkboxes, tabs, menus) with their attributes. It also frames the tool relative to the acting siblings (press_ui_element, set_ui_element_value, click_menu_item), so an agent can place it without opening a schema.

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?

Gives explicit when-to-use ('to see an app before acting on it, rather than a screenshot') and names the follow-up tools to call with the result. It also supplies a when-not/fallback path: apps like games or some cross-platform apps expose little or nothing, in which case take a screenshot instead.

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