Skip to main content
Glama

webview_find_element

Read-only

Find DOM elements inside a running Tauri app's webview by CSS selector, XPath, or text content. 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
Behavior5/5

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

Discloses that it returns the element's HTML, explains fallback behavior for the 'text' strategy (element text content, then placeholder, aria-label, title), and notes that ref IDs work with any strategy. No contradiction with readOnlyHint annotation.

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?

Concise at 5 sentences, front-loaded with purpose, and every sentence adds value. No redundant or extraneous content.

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 tool with 4 parameters and no output schema, the description fully explains behavior, targeting, strategy details, return value, and prerequisites (driver_session). Also provides alternative tool for non-Tauri contexts.

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?

Adds significant meaning beyond the schema: clarifies windowId defaults to 'main', appIdentifier defaults to only connected app, selector interpretation depends on strategy, and details text strategy fallback chain. Schema coverage is 100%, but description enriches each parameter.

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 it finds DOM elements in a Tauri app's webview, specifies supported selector strategies (CSS, XPath, text), and differentiates from sibling tools like webview_dom_snapshot and webview_select_element. The verb 'find' and resource 'DOM elements' are specific.

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?

Explicitly states when not to use: 'For browser pages or documentation sites, use Chrome DevTools MCP instead.' Also provides context on requiring an active driver_session and targeting behavior for appIdentifier, giving clear guidance on proper usage.

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