Skip to main content
Glama

Robot Actions — Remote Device Control

Session page source

session_page_source
Read-onlyIdempotent

Return what a WebDriver session is currently showing as markup: the rendered DOM as HTML for a browser session, the native view hierarchy as XML for a mobile session. This is the WHOLE document — it can be very large, so prefer session_find_element when you only need one element, and reach for this when you need to see the structure or search it yourself. Addressed by sessionId; the device-side equivalents are device_page_source and ios_page_source (by udid), which return the on-screen hierarchy without a WebDriver session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesSession ID

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint, so safety is covered. The description adds real behavioral context beyond them: the payload is the WHOLE document and 'can be very large,' and the serialization differs by platform (HTML vs XML). It stops short of describing pagination, truncation, or how the source is framed in the response, which is the remaining gap.

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?

Three sentences, all earning their place, with the core purpose and the size warning front-loaded ahead of the alternative-tool routing. Slightly dense but no filler; the platform-format clause could arguably be tightened.

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?

There is no output schema, so the description must carry the return-value burden — and it does, stating the content is rendered DOM as HTML or native view hierarchy as XML and that it is the full document. Combined with the size caveat, addressing key, and sibling routing, an agent has everything needed to call it correctly and anticipate the response.

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?

Only one parameter (sessionId) and schema description coverage is 100%, so the schema already carries the parameter. The description adds marginal meaning by implying sessionId is a WebDriver session identifier as opposed to the udid used by the device-side equivalents. That is a small semantic gain over the schema, consistent with the baseline 3.

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 gives a specific verb+resource ('Return what a WebDriver session is currently showing as markup') and immediately scopes the output: HTML for browser sessions, XML for mobile sessions. It names the siblings it is not (session_find_element, device_page_source, ios_page_source) and the key that distinguishes them (sessionId vs udid), so an agent can route correctly without opening any 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?

Explicit when-to-use and when-not: prefer session_find_element 'when you only need one element,' and use this 'when you need to see the structure or search it yourself.' It also states the alternative family (device_page_source / ios_page_source) and the condition selecting it (udid-addressed, no WebDriver session). Nothing is left to inference.

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