Skip to main content
Glama

Robot Actions — Remote Device Control

webpage_get_text

Get the visible text (innerText, trimmed) 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). For reading a label/status/result after an action. Throws if the target does not resolve. For full HTML use webpage_get_dom; for many elements at once use webpage_snapshot, or ios_safari_elements / android_devtools_elements.

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.
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 to read"New value: +"CSS selector for the target element. Provide this or `ref`."
    • changedInput schema / required
      Previous value: -[
      -  "udid",
      -  "selector"
      -]New value: +[
      +  "udid"
      +]
  2. First observed

TDQS

A4.7/5.0
Behavior4/5

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

With no annotations provided, the description carries the burden of behavioral disclosure. It discloses the error condition ('Throws if the target does not resolve'), clarifies the output is 'trimmed' text, and states auto-detection of platform. However, it does not explicitly mention that the operation is read-only or whether it waits for the element to appear, but for a 'Get' operation these are largely implied. This is adequate but not exhaustive.

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 description is four sentences, each contributing necessary information: the core function, a typical use case, an error behavior, and alternative tools. It is front-loaded with the primary action and avoids redundancy. Every sentence earns its place.

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?

For a relatively simple read operation with a single required parameter (udid) and auto-picked pageId, the description covers the essential aspects: what it returns (visible text), how to target the element (selector or ref), platform support, error behavior, and alternatives. The lack of an output schema is acceptable because the description implies the return is the text itself, and no additional state changes or pagination are expected.

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 description coverage is 100%, so the baseline is 3. The description adds extra meaning beyond the schema by explaining the advantage of using `ref`: '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.' This adds semantic value beyond the simple schema text.

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 and resource: 'Get the visible text (innerText, trimmed) of an element in the device browser page'. It distinguishes itself from siblings by explicitly naming alternatives: 'For full HTML use webpage_get_dom; for many elements at once use webpage_snapshot, or ios_safari_elements / android_devtools_elements.' The platform scope ('iOS Safari or Android Chrome, auto-detected') further clarifies the intent.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides explicit usage context: 'For reading a label/status/result after an action' and clear exclusions/alternatives: 'For full HTML use webpage_get_dom; for many elements at once use webpage_snapshot, or ios_safari_elements / android_devtools_elements.' This leaves no ambiguity about when to select this tool over siblings.

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