Skip to main content
Glama

native-find-views

Read-only

Locate specific UIViews in a running app by class name, accessibility identifier, label, tag, or React Native nativeID—without dumping the full native hierarchy.

Instructions

Search for specific UIViews in the running app by class name, accessibility identifier, accessibility label, tag or React Native nativeID; at least one of these params is required. Use when you need to locate a specific view by its properties without dumping the entire native-full-hierarchy. Returns { status: "ok", matches }: the matching views with their frames, properties, optional ancestors and optional children. Frames are in points. frame and center are relative to the superview, and windowFrame turns with the UI. screenFrame is on the axes of the UI as the user sees it, also when the UI is landscape. To tap a view, divide the centre of its screenFrame by the screen size in points, which native-full-hierarchy returns as screen (maxDepth: 1 is enough), and pass the result to gesture-tap. Matches are not filtered for visibility. Before tapping, call native-view-at-point with hitTest: true at that centre, with skipClasses ["UITextEffectsWindow"]. If it does not return the match or a descendant, check a screenshot. If status is restart_required: follow the message (usually restart-app), then retry. If status is service_stale: the app is already injected, so restarting it cannot help. Restart the tool-server (argent server stop && argent server start --detach) and retry. If the same status comes back after that restart, stop restarting: follow the message, which names the terminal fallback. If status is connect_pending: the app is injected and still connecting. Do not restart it, wait a few seconds and retry. If status is init_failed: follow the message (re-boot the simulator) rather than retrying. An Apple system app is rejected outright (terminal: never retry it).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "udid": "<udid>",
      "bundleId": "<bundleId>"
    },
    "name": "native-find-views"
  }
}

Input Schema

NameRequiredDescriptionDefault
tagNoUIView tag integer to match
udidYesSimulator UDID
labelNoAccessibility label to match (exact)
fieldsNoView fields to include. Defaults: pointer, className, tag, frame, windowFrame, screenFrame, bounds, hidden, alpha, opaque, clipsToBounds, userInteractionEnabled, depth, identifier, label, layerName, nativeID. Additional: center, transform, contentMode, backgroundColor, tintColor, value, firstResponder
bundleIdYesBundle ID of the app
nativeIDNoReact Native nativeID prop to match (exact)
classNameNoUIView class name to match (exact, e.g. UIButton)
identifierNoAccessibility identifier to match (exact)
includeChildrenNoInclude child views for each matched view (default true)
includeAncestorsNoInclude ancestor chain for each matched view (default true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / fields / description
      Previous value: -"View fields to include. Defaults: className, frame, hidden, alpha, identifier, label, nativeID, userInteractionEnabled, depth. Additional: pointer, tag, windowFrame, screenFrame, bounds, center, opaque, clipsToBounds, transform, contentMode, backgroundColor, tintColor, layerName"New value: +"View fields to include. Defaults: pointer, className, tag, frame, windowFrame, screenFrame, bounds, hidden, alpha, opaque, clipsToBounds, userInteractionEnabled, depth, identifier, label, layerName, nativeID. Additional: center, transform, contentMode, backgroundColor, tintColor, value, firstResponder"
    • removedInput schema / properties / tag / maximum
      Removed value: -9007199254740991
    • removedInput schema / properties / tag / minimum
      Removed value: --9007199254740991
  2. Changed1 schema field changedv0.26.0
    • changedInput schema / properties / fields / description
      Previous value: -"View fields to include. Defaults: className, frame, hidden, alpha, identifier, label, nativeID, userInteractionEnabled, depth. Additional: pointer, tag, windowFrame, bounds, center, opaque, clipsToBounds, transform, contentMode, backgroundColor, tintColor, layerName"New value: +"View fields to include. Defaults: className, frame, hidden, alpha, identifier, label, nativeID, userInteractionEnabled, depth. Additional: pointer, tag, windowFrame, screenFrame, bounds, center, opaque, clipsToBounds, transform, contentMode, backgroundColor, tintColor, layerName"
  3. First observedv0.15.0

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare readOnlyHint=true, but the description goes far beyond: it documents the return envelope, frame/center/windowFrame/screenFrame coordinate semantics, the caveat that matches are not filtered for visibility, and detailed per-status recovery paths (restart_required, service_stale, connect_pending, init_failed) including the anti-pattern of repeated restarts. It also discloses that Apple system apps are rejected outright — behavior no annotation conveys.

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 purpose, then return shape, then workflow, then status handling — a sensible ordering. The error-status block is long and somewhat dense, but nearly every sentence carries actionable recovery information, so little is wasted.

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?

There is no output schema, and the description compensates fully by describing the { status, matches } shape, coordinate frames, and all documented failure statuses with remedies. For a 10-parameter read tool with no output contract, nothing an agent needs is missing.

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?

Schema coverage is 100%, so baseline is 3, but the description adds a constraint the schema does not express — that at least one match key (class name, identifier, label, tag, nativeID) is required, which is not encoded as an anyOf in the schema. It also frames the fields/ancestors/children parameters through the return-value discussion.

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 ("Search for specific UIViews in the running app"), enumerates all five match keys, and explicitly contrasts with the sibling native-full-hierarchy. An agent can distinguish this from hierarchy-dumping tools without opening either 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?

Explicit when-to-use ("locate a specific view by its properties without dumping the entire native-full-hierarchy"), plus a concrete downstream workflow (call native-view-at-point with hitTest: true, then gesture-tap, or fall back to screenshot). Alternatives and exclusions are named rather than implied.

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