Skip to main content
Glama
zillow
by zillow

selectAllText

Select all text in focused input fields on mobile devices using long press and tap actions for Android and iOS platforms.

Instructions

Select all text in the currently focused input field using long press + tap on 'Select All'

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
platformYesPlatform of the device

Implementation Reference

  • Registration of the 'selectAllText' tool using ToolRegistry.registerDeviceAware, specifying name, description, schema, and handler.
      "selectAllText",
      "Select all text in the currently focused input field using long press + tap on 'Select All'",
      selectAllTextSchema,
      selectAllTextHandler,
      true // Supports progress notifications
    );
  • The main handler function for the 'selectAllText' MCP tool. It creates an instance of SelectAllText and executes it, then formats the response.
    const selectAllTextHandler = async (device: BootedDevice, args: SelectAllTextArgs, progress?: ProgressCallback) => {
      try {
        const selectAllText = new SelectAllText(device);
        const result = await selectAllText.execute(progress);
    
        return createJSONToolResponse({
          message: "Selected all text in focused input field",
          observation: result.observation,
          ...result
        });
      } catch (error) {
        throw new ActionableError(`Failed to select all text: ${error}`);
      }
    };
  • Zod schema defining the input arguments for the selectAllText tool (platform only).
    export const selectAllTextSchema = z.object({
      platform: z.enum(["android", "ios"]).describe("Platform of the device")
    });
  • The core execute method of the SelectAllText class, which performs the actual logic: observes screen, finds focused text input, double-taps its center to select all.
    async execute(progress?: ProgressCallback): Promise<SelectAllTextResult> {
      return this.observedInteraction(
        async (observeResult: ObserveResult) => {
          try {
    
            // Find the focused text input field
            const targetElement = this.elementUtils.findFocusedTextInput(observeResult.viewHierarchy);
    
            // If no focused element, find any text input field
            if (!targetElement) {
              throw new ActionableError("No focused text input field found. Please focus on a text field first.");
            }
    
            // Get center coordinates of the text field
            const tapPoint = this.elementUtils.getElementCenter(targetElement);
    
            await this.adb.executeCommand(`shell input tap ${tapPoint.x} ${tapPoint.y}`);
            await new Promise(resolve => setTimeout(resolve, 100));
            await this.adb.executeCommand(`shell input tap ${tapPoint.x} ${tapPoint.y}`);
    
            return {
              success: true
            };
          } catch (error) {
            return {
              success: false,
              error: `Failed to select all text: ${error instanceof Error ? error.message : String(error)}`
            };
          }
        },
        {
          changeExpected: false,
          tolerancePercent: 0,
          timeoutMs: 500,
          progress
        }
      );
    }
  • TypeScript interface defining the output structure of the selectAllText operation.
    export interface SelectAllTextResult {
      success: boolean;
      observation?: ObserveResult;
      error?: string;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It describes the action ('long press + tap on 'Select All'') but lacks details on permissions, side effects, error conditions, or response behavior. For a tool with no annotation coverage, this is insufficient for full transparency.

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 that front-loads the key action ('Select all text') and provides necessary context without waste. Every word contributes to understanding the tool's purpose and usage.

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

Completeness3/5

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

Given the tool's low complexity (one parameter, no output schema, no annotations), the description is adequate but has gaps. It explains what the tool does but lacks behavioral details and explicit usage guidelines. For a simple UI automation tool, this is minimally viable but not fully comprehensive.

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

Parameters4/5

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

The input schema has 100% coverage, fully documenting the single parameter 'platform' with its enum values. The description does not add any parameter-specific information beyond the schema, but with only one parameter and high schema coverage, a baseline of 3 is appropriate. The score is elevated to 4 because the tool has zero parameters in practice (the description implies no additional inputs beyond the schema), making it straightforward.

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 specific action ('Select all text') and the target resource ('currently focused input field'), using precise verbs. It distinguishes itself from sibling tools like 'clearText' or 'inputText' by focusing on text selection rather than text modification or input.

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

Usage Guidelines3/5

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

The description implies usage by specifying the context ('currently focused input field'), but it does not explicitly state when to use this tool versus alternatives like 'clearText' or 'inputText'. No exclusions or prerequisites are mentioned, leaving usage guidance incomplete.

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/zillow/auto-mobile'

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