Skip to main content
Glama

webview_find_element

Read-only

Find DOM elements in a running Tauri app's webview using CSS selectors, XPath, or text content matching. Returns the element's HTML.

Instructions

[Tauri Apps Only] Find DOM elements in a running Tauri app's webview. Supports CSS selectors (default), XPath expressions, and text content matching via the strategy parameter. The "text" strategy first searches element text content, then falls back to placeholder, aria-label, and title attributes. Returns the element's HTML. 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. For browser pages or documentation sites, use Chrome DevTools MCP instead.

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.
selectorYesThe selector to find: CSS selector (default), XPath expression, text content, or ref ID (e.g., "ref=e3"). Interpretation depends on strategy.
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 indicate readOnlyHint=true, and the description adds that the tool returns the element's HTML. It details the 'text' strategy fallback behavior. No contradictions. Slightly ambiguous about returning one vs. multiple elements, but overall transparent.

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 about six sentences, each carrying useful information. It front-loads the restriction and core purpose, and every sentence earns its place without redundancy or verbosity.

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?

Given no output schema, the description specifies the return value (element's HTML). It covers purpose, usage, parameter nuances, and when not to use. With multiple siblings, it gives enough context for an agent to select this tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds meaningful context: explains 'text' strategy fallback to placeholder, aria-label, title attributes, and mentions ref IDs work with any strategy. These details are not in the schema descriptions, adding significant value.

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 clearly states the tool finds DOM elements in a Tauri webview, specifies supported strategies (CSS, XPath, text), and distinguishes itself from Chrome DevTools MCP for browser pages. The verb 'Find' and resource 'DOM elements' are specific, and the restriction '[Tauri Apps Only]' sets clear context.

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?

The description explains prerequisites (active driver_session), app targeting behavior, and explicitly says to use Chrome DevTools MCP for browser pages. It lacks direct comparison to sibling tools like webview_dom_snapshot, but the alternative guidance is strong.

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