Skip to main content
Glama

Robot Actions — Remote Device Control

iOS Safari elements

ios_safari_elements
Read-onlyIdempotent

Extract locator-friendly element data from a Safari page for building Playwright/Selenium locators. For each element (interactive/meaningful elements by default, or those matching selector) returns: tag, trimmed text, key attributes (id/name/type/role/aria-label/placeholder/href/value/data-testid + any data-*), classes, bounding box {x,y,w,h} and a visibility flag. USE suggested — the locator worth writing (id, then test-id, name, aria-label, placeholder), each verified unique before it is offered, with playwright giving the same target in getByRole/getByTestId form. css and xpath are diagnostic fallbacks, not recommendations: the CSS path is an nth-of-type chain over layout classes and does not belong in a page object. When suggested is null nothing stable exists — act via ref and treat the missing test-id as the real finding. Set includeStyles=true to also return a curated set of computed styles per element. Omit pageId to auto-pick the active Safari page.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
udidYesiOS device UDID
limitNoMax elements to return (default 150)
pageIdNoCDP target id from ios_safari_list_pages. Omit it to use the page ios_safari_navigate last landed on (or, failing that, the first loaded page) — only pass it to target a DIFFERENT tab
selectorNoCSS selector to scope extraction (default: interactive/meaningful elements)
includeStylesNoInclude a curated set of computed styles per element (default false)
platformVersionNoIgnored (kept for compatibility)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / pageId / description
      Previous value: -"CDP target id from ios_safari_list_pages — auto-picked when omitted"New value: +"CDP target id from ios_safari_list_pages. Omit it to use the page ios_safari_navigate last landed on (or, failing that, the first loaded page) — only pass it to target a DIFFERENT tab"
  2. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Annotations already declare read-only/idempotent/non-destructive, and the description adds substantial behavior beyond them: each `suggested` locator is verified unique before being offered, the CSS path is an unstable nth-of-type chain unsuitable for page objects, a null `suggested` means no stable locator exists so the caller should act via `ref`, and includeStyles returns a curated style set. This is rich, decision-relevant disclosure.

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?

Purpose is front-loaded and every sentence carries substantive guidance about the returned locator fields. It is dense and long, with heavy emphasis on the suggested-vs-css/xpath distinction, but that content is justified by the tool's complexity and little is pure filler.

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 no output schema, the description fully carries the burden by enumerating the return shape (tag, trimmed text, key attributes, classes, bounding box, visibility, suggested/playwright/css/xpath). For a complex extraction tool this covers everything an agent needs to invoke and interpret it correctly.

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 the schema already documents every parameter. The description restates the key behaviors (selector default, includeStyles, pageId auto-pick) with roughly the same information the schema provides rather than adding syntax or format detail, so the baseline 3 applies.

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 precise verb+resource+intent: 'Extract locator-friendly element data from a Safari page for building Playwright/Selenium locators.' This clearly distinguishes it from DOM-dump siblings like ios_safari_get_dom and generic finders like ios_find_element. An agent can tell immediately what it is for and what it returns.

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?

Gives strong operational guidance: USE `suggested`, treat `css`/`xpath` as diagnostic fallbacks only, set includeStyles=true when styles are wanted, and omit pageId to auto-pick the active page. It does not explicitly name sibling alternatives (e.g. ios_safari_get_dom) and when to prefer them, so it falls short of the 5 bar for explicit when-not/alternatives routing.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources