Skip to main content
Glama

webview_interact

[Tauri Apps Only] Click, hover, right-click, scroll, swipe, focus, or perform gestures in a Tauri app webview. Supported actions: click, double-click, long-press, scroll, swipe, focus, hover, right-click.

Instructions

[Tauri Apps Only] Click, hover, right-click, scroll, swipe, focus, or perform gestures in a Tauri app webview. Supported actions: click, double-click, long-press, scroll, swipe, focus, hover, right-click. Supports CSS selectors (default), XPath, and text content matching via the strategy parameter. When using a text selector that matches multiple visible elements, you must provide the nth parameter to disambiguate, or the tool will throw an error listing the candidates. Requires active driver_session. For browser interaction, use Chrome DevTools MCP instead.

Input Schema

NameRequiredDescriptionDefault
xNoX coordinate for direct coordinate interaction
yNoY coordinate for direct coordinate interaction
nthNoZero-based index to pick one of several matching elements. Omit when the selector is unique. Required when a text selector matches more than one visible element.
toXNoEnding X coordinate for swipe
toYNoEnding Y coordinate for swipe
fromXNoStarting X coordinate for swipe
fromYNoStarting Y coordinate for swipe
actionYesType of interaction to perform
scrollXNoHorizontal scroll amount in pixels (positive = right)
scrollYNoVertical scroll amount in pixels (positive = down)
durationNoDuration in ms for long-press or swipe (default: 500ms for long-press, 300ms for swipe)
selectorNoElement selector: CSS selector (default), XPath expression, text content, or ref ID (e.g., "ref=e3")
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
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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.0.1
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "click",
      -  "double-click",
      -  "long-press",
      -  "scroll",
      -  "swipe",
      -  "focus"
      -]New value: +[
      +  "click",
      +  "double-click",
      +  "long-press",
      +  "scroll",
      +  "swipe",
      +  "focus",
      +  "hover",
      +  "right-click"
      +]
    • addedInput schema / properties / nth
      Added value: +{
      +  "description": "Zero-based index to pick one of several matching elements. Omit when the selector is unique. Required when a text selector matches more than one visible element.",
      +  "minimum": 0,
      +  "type": "integer"
      +}
  2. Addedv0.11.1

TDQS

A4.3/5.0
Behavior4/5

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

Annotations declare readOnlyHint=false, destructiveHint=false, and openWorldHint=false, so the agent already knows this mutates local UI but is not destructive or open-world. The description adds real behavioral context beyond that: the driver_session prerequisite and the error-on-ambiguity behavior when a text selector matches multiple elements.

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?

Front-loaded with the environment restriction and the core action list, then layers selectors, the nth rule, and prerequisites. The action list is repeated against the enum and the 'Supported actions' enumeration is somewhat redundant, but no sentence is wasted.

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 15-parameter mutation tool with annotations and no output schema, the description covers environment scope, prerequisites, selector semantics, and the key disambiguation rule. Coordinate/swipe/duration details live in the schema, which is acceptable given 100% coverage, though it could note the return behavior of interactions.

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?

Schema description coverage is 100%, so all 15 parameters are already documented, including nth, strategy fallbacks, duration defaults, and coordinate semantics. The description restates the nth disambiguation rule and adds only the error behavior on ambiguous matches, which is marginal value over the schema.

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?

States a specific verb set (click, hover, scroll, etc.) and resource (Tauri app webview) in the first sentence, and immediately scopes the tool with '[Tauri Apps Only]'. An agent can distinguish it from webview_keyboard and webview_execute_js without opening the 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?

Explicitly states the environment constraint (Tauri only), the prerequisite ('Requires active driver_session'), and the alternative for the non-applicable case ('For browser interaction, use Chrome DevTools MCP instead'). This is exactly the when/when-not/alternatives pattern.

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