Skip to main content
Glama
omarchy-desktop

omarchy-desktop

by martoast

Wait for an element to appear

wait_for_element

Poll the accessibility tree until an element matching text or role appears or the timeout elapses, replacing blind sleeps for page loads, AJAX content, or animations.

Instructions

Poll the accessibility tree until an element matching text/role appears (or the timeout elapses). Use this instead of blind sleeps when waiting on page loads, AJAX content, or animations to settle. Getting the role wrong here is expensive — it polls the FULL timeout for a role that can never match. If unsure of the exact role, omit role and match on text alone.

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": "wait_for_element"
  }
}

Input Schema

NameRequiredDescriptionDefault
roleNoReal AT-SPI role name only (button, link, entry, heading, ...) — NOT HTML-ish names like 'textbox' or 'input'. Omit if unsure.
textNo
poll_msNo
timeout_msNo
window_addressNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It usefully discloses the polling mechanism, the timeout cost of a wrong role, and the safe fallback of text-only matching. It does not say what the tool returns (an element handle, a boolean, or a thrown error) or what happens when the timeout elapses, which for a tool with no output schema is a real gap.

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?

Three sentences, front-loaded with the core operation, and each sentence earns its place: mechanism, when to prefer it over sleeps, and the failure mode plus the safe fallback. No restatement of the name or title.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a five-parameter tool with no annotations and no output schema, the description covers the how and the when well but omits return values and timeout-failure behavior. An agent knows how to invoke it but not what it gets back or how to branch on failure.

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 only 20%, and only 'role' is documented there, so the description must compensate. It does add meaning for role and text (role and text are alternatives, role may be omitted), but poll_ms, timeout_ms, and window_address are left to their names, defaults, and min/max bounds.

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?

The description states a specific verb and resource: poll the accessibility tree until an element matching text/role appears. The matching criteria and timeout semantics make the operation unambiguous. It does not explicitly contrast itself with the sibling wait_page_settled, so the boundary between 'wait for element' and 'wait for page to settle' is left to inference.

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?

It gives explicit positive guidance ('use this instead of blind sleeps when waiting on page loads, AJAX content, or animations to settle') and a concrete fallback rule ('if unsure of the exact role, omit role and match on text alone'). What is missing is an explicit when-not clause pointing at wait_page_settled or a read/screenshot tool for the case where the needed element is not addressable.

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