ui_find_element
Finds an element in an app's accessibility tree by role and/or label. Scope with app_bundle_id or window_id. Returns an opaque element_ref (usable by ui_click / ui_get_element this session) plus role, label, bounds, enabled, focused. found=false when the app is reachable but no element matches; a...
This record as markdown: /tools/com-local-mcp-local-mcp/ui-find-element.md
What ui_find_element does on Local
AI agents call ui_find_element to retrieve information from Local without modifying anything. It is typically the context-gathering step in research, monitoring, and reporting workflows, before the agent takes action elsewhere.
| Parameter | Type | Required | Description |
|---|---|---|---|
role | string | — | AX role, e.g. AXButton, AXMenuItem, AXTextField. |
index | integer | — | Which match to return if several (default 0). |
label | string | — | AX title/description to match. |
match | string | — | Default contains. |
window_id | string | — | Alternatively scope by a window_id from list_windows. |
app_bundle_id | string | — | Scope the search to this app. |
Parameters from the server's own tool schema.
Why ui_find_element is rated Low
This tool only queries and retrieves data about UI elements from the accessibility tree. It has no side effects—it does not modify state, execute code, or trigger operations. While it requires Accessibility permission and could be used as reconnaissance for subsequent actions (ui_click, ui_get_element), the tool itself is purely a read operation.
From the tool's definition Tool 'finds an element in an app's accessibility tree' and 'Returns an opaque element_ref plus role, label, bounds, enabled, focused'. The description explicitly states it retrieves information about UI elements without modifying or executing actions.
Attacks that exploit this kind of access
The rule that runs ui_find_element safely
PolicyLayer is an MCP gateway: it sits between your AI agents and Local, and checks every tool call against a rule you set before the call runs. Nothing changes on the server itself. For ui_find_element, this is the rule to start with:
ui_find_element is read-only, so it stays allowed. Everything else on the server is denied unless you say otherwise.
The button opens the PolicyLayer dashboard: create your workspace, connect Local, apply this rule, and every ui_find_element call is checked against it from then on.
Questions about ui_find_element
Finds an element in an app's accessibility tree by role and/or label. Scope with app_bundle_id or window_id. Returns an opaque element_ref (usable by ui_click / ui_get_element this session) plus role, label, bounds, enabled, focused. found=false when the app is reachable but no element matches; app_not_found is an explicit error. Requires Accessibility permission. It is categorised as a Read tool in the Local MCP Server, which means it retrieves data without modifying state.
ui_find_element accepts 6 parameters: role, index, label, match, window_id, app_bundle_id. The full parameter table on this page comes from the server's own tool schema.
Register the Local MCP server in PolicyLayer and add a rule for ui_find_element: allow, deny, rate-limit, or require approval. Point your MCP client at the PolicyLayer proxy URL and the rule is enforced on every call, before it reaches Local. Nothing to install.
ui_find_element is a Read tool with low risk. Read-only tools are generally safe to allow by default.
Yes. Add a rate_limit block to the ui_find_element rule in your PolicyLayer policy. For example, setting max: 10 and window: 60 limits the tool to 10 calls per minute. Rate limits are tracked per agent session and reset automatically.
Set action: deny in the PolicyLayer policy for ui_find_element. The AI agent will receive a policy violation error and cannot call the tool. You can also include a reason field to explain why the tool is blocked.
ui_find_element is provided by the Local MCP server (local-mcp). PolicyLayer sits as a proxy in front of this server to enforce policies before tool calls reach the server.
More on Local, and thousands of servers like it.
This server
Across the catalogue