Skip to main content
Glama

Robot Actions — Remote Device Control

Webpage get DOM

webpage_get_dom
Read-onlyIdempotent

Get the rendered outer HTML of the web page open in the device browser — works on BOTH iOS (Safari, via the Web Inspector) and Android (Chrome, via CDP); the platform is auto-detected from the udid. Returns document.documentElement.outerHTML, or the outerHTML of a CSS-selector-matched element when selector is given. On iOS, Safari is launched automatically if it is not already open. Output is capped at 100 000 characters with a truncation notice. This is web-page HTML — for a NATIVE app UI hierarchy use device_page_source (Android) or ios_page_source (iOS).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
udidYesDevice UDID / serial (iOS or Android)
pageIdNoTarget page/tab id — auto-picked when omitted (iOS: appIdKey.pageIdKey; Android: CDP target id)
socketNoAndroid only: abstract unix socket name (default: chrome_devtools_remote)
selectorNoOptional CSS selector — returns outerHTML of the first matching element, or null
platformVersionNoiOS only: platform version for the remote debugger (default: 17.0)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

Annotations only cover the safety profile (readOnly, idempotent, non-destructive, openWorld), and the description adds substantial behavior beyond that: platform auto-detection from udid, automatic Safari launch on iOS, and a 100 000-character output cap with truncation notice. It stops short of noting any auth/debugger-enablement prerequisites, which is why it is not a 5.

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?

A single dense paragraph, but it is front-loaded with the core purpose and every clause carries distinct information (platforms, return value, auto-launch, cap, sibling routing). It could be broken into shorter sentences for scanability.

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 takes on the burden of explaining the return value (documentElement.outerHTML or selector-matched element outerHTML, with truncation) and does so, plus covers cross-platform behavior and the correct sibling for native hierarchies. Nothing an agent needs to call it correctly is missing.

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 all five parameters are already documented. The description restates the selector behavior (first matching element, or null) that the schema already specifies, so it adds no meaning beyond the structured field; baseline 3 is appropriate.

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 specific verb and resource ('Get the rendered outer HTML of the web page open in the device browser') and immediately scopes it to both iOS Safari and Android Chrome. It explicitly distinguishes itself from sibling tools by naming device_page_source and ios_page_source for native UI hierarchies.

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 a clear when-to-use (web page HTML) and a when-not with the named alternative for native app hierarchies. It does not address other potentially overlapping web-DOM siblings such as webpage_snapshot, webpage_get_attribute or webpage_evaluate, so guidance is clear but not fully exhaustive.

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