Skip to main content
Glama

Robot Actions — Remote Device Control

ios_safari_elements

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.7/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and it delivers: it discloses default element selection ('interactive/meaningful elements by default, or those matching `selector`'), output shape, the uniqueness verification of `suggested`, the null behavior ('act via `ref`'), and optional style data via `includeStyles`. No annotations are present to contradict it.

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?

The definition is dense but front-loaded: purpose and return shape come first, followed by prioritized output guidance and one line for optional style/auto-pick behavior. Every sentence adds useful information and there is no filler or repetition of schema text.

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?

The description is complete despite lacking an output schema: it enumerates the return fields, explains the `suggested`/`playwright`/`css`/`xpath` field semantics, covers default and optional behavior, and gives fallback guidance for `suggested === null`. An agent has enough to call it correctly and interpret results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, giving a baseline of 3. The description adds value by explaining the `selector` default, the `pageId` auto-pick behavior, and the semantics of `includeStyles` and `suggested`; it also flags `platformVersion` as ignored. These extras justify one point above baseline.

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?

The description opens with a specific verb-resource combination: 'Extract locator-friendly element data from a Safari page for building Playwright/Selenium locators.' It details what is returned (tag, text, attributes, bounding box, visibility) and distinguishes itself from sibling DOM/page tools by focusing on locator-friendly extraction.

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 strong context: use this when you need Playwright/Selenium locators, and it explicitly tells the agent to prefer `suggested` with `playwright` form and to treat `css`/`xpath` as diagnostic fallbacks. It does not explicitly name alternative sibling tools like ios_locators_for or ios_safari_get_dom, so it falls short of a full when-vs-alternatives statement.

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