ui_wait_for_element
Deterministic synchronization — replaces all sleeps. Polls for an element until it reaches state (present|enabled|focused|absent) or times out. A timeout is an EXPLICIT error, never a false success. Returns {satisfied, waited_ms, element_ref?, bounds?}.
This record as markdown: /tools/com-local-mcp-local-mcp/ui-wait-for-element.md
What ui_wait_for_element does on Local
AI agents invoke ui_wait_for_element to trigger actions in Local. What it does depends on the arguments the agent supplies, and its effects often reach beyond the immediate call: builds kicked off, notifications sent, workflows started.
| Parameter | Type | Required | Description |
|---|---|---|---|
role | string | — | |
label | string | — | |
match | string | — | |
state | string | — | Default present. |
poll_ms | integer | — | Default 150. |
window_id | string | — | |
timeout_ms | integer | — | Default 5000. |
app_bundle_id | string | — |
Parameters from the server's own tool schema.
Why ui_wait_for_element is rated High
This tool itself is synchronization logic, but in the context of browser automation it enables deterministic sequencing of actions (waiting for an element to be clickable, then clicking it). It is not a read-only query since it returns element_ref and participates in control flow that triggers side effects.
From the tool's definition ui_wait_for_element polls DOM for element state changes and returns element references with bounds, enabling conditional triggering of subsequent actions.
Attacks that exploit this kind of access
The rule that runs ui_wait_for_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_wait_for_element, this is the rule to start with:
ui_wait_for_element stays usable, but rate-capped: a runaway agent can't fire it dozens of times a minute. 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_wait_for_element call is checked against it from then on.
Questions about ui_wait_for_element
Deterministic synchronization — replaces all sleeps. Polls for an element until it reaches state (present|enabled|focused|absent) or times out. A timeout is an EXPLICIT error, never a false success. Returns {satisfied, waited_ms, element_ref?, bounds?}. It is categorised as a Execute tool in the Local MCP Server, which means it can trigger actions or run processes. Use rate limits and argument validation.
ui_wait_for_element accepts 8 parameters: role, label, match, state, poll_ms, window_id, timeout_ms, 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_wait_for_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_wait_for_element is a Execute tool with high risk. Execute tools should be rate-limited and have argument validation enabled.
Yes. Add a rate_limit block to the ui_wait_for_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_wait_for_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_wait_for_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.
Across the catalogue