Skip to main content
Glama

observe_webview

Identify debuggable WebView pages in a mobile app and retrieve a compact DOM snapshot of the most content-rich page, optionally filtering by URL match to inspect specific web content.

Instructions

List the app's debuggable WebView pages and return a compact DOM snapshot of the one with the most content (css-selectored). The app must opt in to WebView debugging: on Android WebView.setWebContentsDebuggingEnabled(true), on iOS WKWebView.isInspectable = true (16.4+; Safari needs no opt-in). Pass match (a URL substring/regex) to target a specific page; pin a page in a flow with switchContext "WEBVIEW_@".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
matchNoURL substring/regex selecting a specific page
packageYesThe app package (Android) or bundle id (iOS) hosting the WebView
device_idNoTarget device. An adb serial selects an Android device; a UUID-shaped simulator UDID (from list_devices) selects an iOS simulator and is REQUIRED for iOS — omit it and this call runs against Android. Optional on Android when only one device is attached.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.8.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses the platform-specific opt-in requirements, the selection behavior (most content), and the targeting behavior via `match`. It does not describe the exact shape of the DOM snapshot or failure modes when no debuggable WebView exists, but the core behavioral traits are well covered.

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 dense but well-organized: it front-loads the main action, then gives prerequisites, then parameter guidance, then the alternative. Every sentence earns its place and no filler is present.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with no output schema and no annotations, the description covers the main action, prerequisites, parameter semantics, and the sibling alternative. It could mention what happens when no debuggable WebView is found or how the DOM snapshot is returned, but the essential information for selecting and invoking the tool is present.

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 meaning beyond the schema by explaining that `match` is a URL substring/regex and that `package` is the host app, and it clarifies the device_id behavior (iOS simulator UDID required, Android optional). This is meaningful added context.

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 ('List' and 'return'), a clear resource (debuggable WebView pages / DOM snapshot), and a distinctive selection criterion (the page with the most content, css-selectored). It also names the sibling alternative (switchContext) for pinning a page, which helps distinguish it from other webview tools.

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?

The description explicitly explains when to use this tool: to list debuggable WebView pages and get a compact DOM snapshot, and it gives the opt-in prerequisites per platform. It also tells the agent to pass `match` to target a specific page and to use switchContext for pinning a page in a flow, which is a clear alternative.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.