Skip to main content
Glama

Robot Actions — Remote Device Control

webpage_get_dom

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

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

With no annotations, the description carries the behavioral disclosure burden. It transparently covers cross-platform operation, automatic Safari launch, the exact return value (document.documentElement.outerHTML or selector-matched element), and the 100,000-character truncation notice. It omits the null return for an unmatched selector, but the schema already documents that.

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 dense, purposeful sentences with no filler. The core action and platform scope are front-loaded, followed by return semantics, side effects/limits, then sibling-tool routing. 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 read-only introspection tool with no annotations and no output schema, the description is unusually complete: it covers purpose, platform support, return format, selector behavior, output truncation, a side effect on iOS, and the correct alternative tools for native hierarchies. Nothing critical is missing for correct invocation.

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 the baseline is 3. The description adds useful context for udid (platform auto-detection) and selector (returns outerHTML of the first match), but mostly restates what the schema already says. Parameters like socket and platformVersion are left entirely to the schema.

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 clear, specific action and resource: 'Get the rendered outer HTML of the web page open in the device browser.' It distinguishes itself from native-app hierarchy tools and platform-specific DOM tools by naming the Web Inspector/CDP mechanisms and explicitly contrasting with device_page_source/ios_page_source.

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?

Provides explicit routing guidance: use this for web-page HTML in a device browser, and use device_page_source or ios_page_source for native UI hierarchy. It does not explicitly name android_devtools_get_dom or ios_safari_get_dom as alternatives, but the platform auto-detection note and native-app exclusions make the intended use clear.

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