Skip to main content
Glama

webview_dom_snapshot

Read-only

Capture a structured DOM snapshot of a Tauri app's webview. Choose between accessibility or structure types to understand UI semantics or page layout, scoped by selector.

Instructions

[Tauri Apps Only] Get a structured DOM snapshot of a Tauri app's webview. Supports different snapshot types for AI consumption. The "accessibility" type returns a YAML representation of the accessibility tree similar to Playwright's aria snapshots, including roles, names, states, and element refs. Use this for understanding UI semantics, finding interactive elements, or accessibility testing. The "structure" type returns a YAML representation of the DOM hierarchy with element tag names, IDs, CSS classes, and data-testid attributes (if present). Use this for understanding page layout, debugging CSS selectors, or locating elements by class/ID. Use the optional selector parameter to scope the snapshot to a subtree. The selector supports CSS (default), XPath, and text content matching via the strategy parameter. Requires active driver_session. Targets the only connected app, or the default app if multiple are connected. Specify appIdentifier (port or bundle ID) to target a specific app.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
windowIdNoWindow label to target (defaults to "main")
appIdentifierNoApp port or bundle ID to target. Defaults to the only connected app or the default app if multiple are connected.
typeYesSnapshot type
selectorNoSelector to scope the snapshot: CSS selector (default), XPath, text content, or ref ID. If omitted, snapshots entire document.
strategyNoSelector strategy: "css" (default) for CSS selectors, "xpath" for XPath expressions, "text" to find elements by text content, with fallback to placeholder, aria-label, and title attributes. Ref IDs (e.g., "ref=e3") work with any strategy.css
Behavior4/5

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

Annotations already indicate readOnlyHint=true, so the description is not required to repeat that. It adds valuable behavioral context: requires an active driver_session, targets the only connected app or requires appIdentifier for multi-app scenarios, and describes output as YAML representations. No contradictions with annotations.

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?

Single paragraph of 5-6 sentences, front-loaded with the main purpose, then organized by type, selector usage, and targeting. Every sentence adds value without redundancy. Perfectly sized for an AI agent to quickly grasp the tool's capabilities.

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?

Given the complexity (5 params, 1 required, no output schema), the description adequately covers purpose, types, usage scenarios, scoping, targeting, and strategies. It lacks an explicit description of the return format beyond 'YAML representation', but for a read-only snapshot tool, this is sufficient. Minor omission: no example output or error conditions.

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 coverage is 100%, so baseline is 3. The description adds meaning beyond the schema by explaining the two types in detail, including the analogy to Playwright's aria snapshots, and elaborating on the strategy parameter (e.g., fallback to placeholder, aria-label, title). This provides richer context for parameter selection.

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?

Description clearly states it gets a structured DOM snapshot of a Tauri webview, with two distinct types (accessibility and structure) that serve different purposes. It distinguishes itself from siblings like webview_find_element and webview_get_pointed_element by focusing on full-tree snapshots rather than individual element queries.

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?

Description provides explicit use cases for each snapshot type: 'understanding UI semantics, finding interactive elements, or accessibility testing' for accessibility, and 'understanding page layout, debugging CSS selectors, or locating elements by class/ID' for structure. It mentions prerequisites (active driver_session) and scoping via selector. However, it does not explicitly mention when NOT to use this tool or alternative sibling tools for more targeted queries.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hypothesi/mcp-server-tauri'

If you have feedback or need assistance with the MCP directory API, please join our Discord server