Skip to main content
Glama
Radek44

MCP Tauri Automation

by Radek44

type_text

Automate text input into desktop application fields using CSS selectors to specify target elements and define text content for testing workflows.

Instructions

Type text into an input field or editable element

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
selectorYesCSS selector to identify the input element
textYesText to type into the element
clearNoWhether to clear existing text before typing. Default: false

Implementation Reference

  • Main handler function for the 'type_text' tool. Calls the driver's typeText method and wraps the result in a ToolResponse.
    export async function typeText(
      driver: TauriDriver,
      params: TypeTextParams
    ): Promise<ToolResponse<{ message: string }>> {
      try {
        await driver.typeText(params.selector, params.text, params.clear);
    
        return {
          success: true,
          data: {
            message: `Typed text into element: ${params.selector}`,
          },
        };
      } catch (error) {
        return {
          success: false,
          error: error instanceof Error ? error.message : String(error),
        };
      }
    }
  • TypeScript interface defining the input parameters for the type_text tool.
    export interface TypeTextParams {
      /** CSS selector for the input element */
      selector: string;
      /** Text to type */
      text: string;
      /** Whether to clear existing text first */
      clear?: boolean;
    }
  • src/index.ts:116-138 (registration)
    Tool registration in the MCP server, including name 'type_text' and input schema matching TypeTextParams.
    {
      name: 'type_text',
      description: 'Type text into an input field or editable element',
      inputSchema: {
        type: 'object',
        properties: {
          selector: {
            type: 'string',
            description: 'CSS selector to identify the input element',
          },
          text: {
            type: 'string',
            description: 'Text to type into the element',
          },
          clear: {
            type: 'boolean',
            description: 'Whether to clear existing text before typing. Default: false',
            default: false,
          },
        },
        required: ['selector', 'text'],
      },
    },
  • src/index.ts:274-284 (registration)
    Dispatch handler in the CallToolRequestSchema switch statement that invokes the typeText handler.
    case 'type_text': {
      const result = await typeText(driver, args as any);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Low-level implementation in TauriDriver class that performs the actual element selection, clearing, and value setting using WebDriverIO.
    async typeText(selector: string, text: string, clear: boolean = false): Promise<void> {
      this.ensureAppRunning();
    
      const element = await this.appState.browser!.$(selector);
      if (!(await element.isExisting())) {
        throw new Error(`Element not found: ${selector}`);
      }
    
      if (clear) {
        await element.clearValue();
      }
    
      await element.setValue(text);
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal information. It implies a write operation ('type text') but doesn't cover critical aspects like error handling (e.g., if selector fails), side effects (e.g., focus changes), or performance considerations (e.g., typing speed).

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 a single, efficient sentence with zero wasted words. It's front-loaded with the core purpose and appropriately sized for a straightforward tool, earning full marks for conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (interactive UI operation) and lack of annotations or output schema, the description is incomplete. It doesn't explain return values (e.g., success/failure), error conditions, or dependencies (e.g., requires an active app context), leaving significant gaps for an agent to use it effectively.

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 fully documents all parameters (selector, text, clear). The description adds no additional meaning beyond what's in the schema, such as examples of valid selectors or when to use the 'clear' option. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('type text') and target ('into an input field or editable element'), providing a specific verb+resource combination. However, it doesn't differentiate from potential sibling tools like 'click_element' or 'get_element_text' that might also interact with input fields, preventing a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., element must be visible/editable), exclusions (e.g., not for read-only elements), or comparisons with sibling tools like 'click_element' for interaction or 'get_element_text' for reading.

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/Radek44/mcp-tauri-automation'

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