Skip to main content
Glama

Robot Actions — Remote Device Control

Webpage get text

webpage_get_text
Read-onlyIdempotent

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

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

Annotations already declare readOnly, idempotent, non-destructive and open-world, so the safety profile is covered. The description goes beyond them by specifying the returned form (innerText, trimmed), the failure mode ("Throws if the target does not resolve"), and automatic iOS Safari / Android Chrome detection. It stops short of return-shape or pagination detail, so a 4 rather than 5.

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?

Four compact sentences, front-loaded with the core action, then usage context, then failure behavior, then sibling routing. Every clause carries distinct information with no repetition of schema or annotations.

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?

No output schema, but the description explains what is returned (visible, trimmed text) and what happens on failure (throws), and it maps the adjacent tools an agent might confuse it with. For a trivial read-only scrape this leaves nothing needed to call 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%, and the schema already explains ref vs selector in depth (positional resilience, reachability). The description only names the two addressing modes, adding no format or syntax detail beyond the schema, so the baseline 3 is correct.

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 (get the visible innerText of a browser element) and immediately scopes it by selector or ref, with platform auto-detection. It explicitly names what it is not (webpage_get_dom for HTML, webpage_snapshot for bulk), so the agent can pick it apart from siblings without opening a schema.

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?

Gives the triggering situation ("For reading a label/status/result after an action") and routes other cases to named alternatives: full HTML to webpage_get_dom, many elements to webpage_snapshot or ios_safari_elements / android_devtools_elements. When-to-use and alternatives are both explicit.

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