Skip to main content
Glama

Robot Actions — Remote Device Control

webpage_get_attribute

Get one attribute (e.g. href, value, aria-label, data-*) of an element in the device browser page, by CSS selector or by a ref from a page-elements listing (iOS Safari or Android Chrome, auto-detected). value is null when the element exists but the attribute is absent. Throws only when the target itself does not resolve.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoElement ref from a page-elements listing, e.g. "e12". Provide this or `selector`. A ref points straight at the element it was issued for, so it survives markup that shifted position, and it can address elements no CSS selector can reach from the top of the page.
nameYesAttribute name to read, e.g. "href", "value", "aria-label"
udidYesDevice UDID / serial (iOS or Android)
pageIdNoTarget page/tab id — auto-picked when omitted
socketNoAndroid only: abstract unix socket name (default: chrome_devtools_remote)
selectorNoCSS selector for the target element. Provide this or `ref`.
platformVersionNoIgnored (kept for compatibility)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / ref
      Added value: +{
      +  "description": "Element ref from a page-elements listing, e.g. \"e12\". Provide this or `selector`. A ref points straight at the element it was issued for, so it survives markup that shifted position, and it can address elements no CSS selector can reach from the top of the page.",
      +  "type": "string"
      +}
    • changedInput schema / properties / selector / description
      Previous value: -"CSS selector for the element"New value: +"CSS selector for the target element. Provide this or `ref`."
    • changedInput schema / required
      Previous value: -[
      -  "udid",
      -  "selector",
      -  "name"
      -]New value: +[
      +  "udid",
      +  "name"
      +]
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden. It discloses the null-return case when the attribute is absent, states it throws only when the target does not resolve, and explains the auto-detection of iOS/Android. This covers the key behavioral aspects an agent needs, including error conditions.

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 concise, front-loaded sentences with zero waste. The purpose is stated first, followed by edge-case behavior and the only error condition. Every sentence earns its place.

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

Completeness4/5

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

For a tool with 7 parameters and no output schema, the description covers the essential behaviors: targeting methods, auto-detection, null handling, and error semantics. It does not explicitly state the return type (implied as string), but that is minor given the clear examples. It is complete enough for correct invocation.

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%, so the baseline is 3. The description adds valuable context for the two main parameters (ref and selector) by explaining the trade-offs: ref survives markup shifts and can reach elements no CSS selector can. It also clarifies the return null behavior, which is not in the schema. This goes beyond the 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 states a specific verb ('Get'), a resource ('one attribute'), and the scope ('device browser page'), with concrete examples (href, value, aria-label, data-*). It clearly distinguishes from siblings like web_get_attribute and playwright_get_attribute by specifying the mobile device context and auto-detection of iOS Safari/Android Chrome.

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?

The description clearly explains the two targeting methods (CSS selector or ref) and the auto-detection behavior, giving clear context on when to use it. However, it does not explicitly mention alternatives or exclusions (e.g., 'use web_get_attribute for desktop browsers'), so it falls short of a 5 but is still well-defined.

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