Skip to main content
Glama

webview_keyboard

[Tauri Apps Only] Type text or send keyboard events in a Tauri app. The selector parameter (for "type" action) supports CSS selectors (default), XPath, and text content matching via the strategy parameter. Requires active driver_session.

Instructions

[Tauri Apps Only] Type text or send keyboard events in a Tauri app. The selector parameter (for "type" action) supports CSS selectors (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. For browser keyboard input, use Chrome DevTools MCP instead.

Input Schema

NameRequiredDescriptionDefault
keyNoKey to press (required for "press/down/up" actions, e.g., "Enter", "a", "Escape")
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.
textNoText to type (required for "type" action)
actionYesKeyboard action type: "type" for typing text into an element, "press/down/up" for key events
selectorNoElement selector for element to type into (required for "type" action): CSS selector (default), XPath, text content, or ref ID
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")
modifiersNoModifier keys to hold
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. Changed1 schema field changedv1.0.1
    • 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.1/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 safety is partly covered; the description adds useful context beyond that — session prerequisite, targeting resolution rules (only connected app, else default), and appIdentifier semantics. It stops short of stating effects like whether existing field content is overwritten or whether focus is required.

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?

Four tight sentences, front-loaded with the platform constraint, followed by targeting rules and the alternative. No filler, though the selector/strategy sentence duplicates schema detail and could be dropped.

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 nine-parameter mutation tool with no output schema, the description covers platform scope, prerequisite session, target resolution, and the browser alternative. Remaining gaps (post-typing state, error behavior) are minor given the schema is fully documented.

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 the schema already documents all nine parameters including strategy fallbacks and nth semantics. The description largely restates the selector/strategy relationship already present in the schema, adding only the "(for 'type' action)" scoping, which is also in the schema. Baseline 3 applies.

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 and resource ("Type text or send keyboard events") scoped precisely to Tauri apps, plus the bracketed platform restriction up front. This distinguishes it immediately from generic siblings like webview_interact and from the browser alternative it names.

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?

Gives a clear prerequisite ("Requires active driver_session") and an explicit out-of-scope redirect ("For browser keyboard input, use Chrome DevTools MCP instead"). It does not, however, differentiate itself from webview_interact, a sibling that may also perform webview input.

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