Skip to main content
Glama

native-view-at-point

Read-only

Inspect the deepest UIView at a raw screen point to find custom-drawn or unlabeled elements, or use hitTest to reveal which view would receive a touch when taps land unexpectedly.

Instructions

Inspect the deepest UIView at a raw native window point: the one drawn there, or with hitTest: true the one that would receive a touch.

Without hitTest it ignores userInteractionEnabled and answers "what is visually here?". Use when a screenshot shows something the accessibility tree does not name (an unlabeled icon, a decorative overlay, a custom-drawn cell) and you need the class, identifier or nativeID of whatever draws it.

With hitTest: true it answers "what would receive the touch?". Use when a tap lands somewhere unexpected or does nothing, to see which control UIKit would hand the touch to: a transparent overlay swallowing it, a parent recognizer, a disabled button.

Returns { status: "ok", view }: the matched view with its class name, frames, identifier, label and layer name, plus its ancestors and subviews as requested. view is null when nothing is drawn at that point, or with hitTest when no touchable view sits under it.

To get x and y from a normalized describe frame, multiply its values by the screen size in points, on the same axes (landscape when the UI is). native-full-hierarchy returns that size as screen (pass maxDepth: 1 and fields: ["className"] to keep it small).

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>",
      "x": "<x>",
      "y": "<y>"
    },
    "name": "native-view-at-point"
  }
}

Input Schema

NameRequiredDescriptionDefault
xYesRaw X coordinate in points, on the axes of the UI as the user sees it (the axes of screenshots and describe frames). NOT normalized [0,1] tap space.
yYesRaw Y coordinate in points, on the same axes as x. NOT normalized [0,1] tap space.
udidYesSimulator UDID
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
hitTestNotrue returns the view that would receive a touch at the point: it respects userInteractionEnabled, close to UIKit hit-testing. Default false: the deepest visible view.
bundleIdYesBundle ID of the app
maxDepthNoMaximum depth for returned child/ancestor serialization (default 150). Must be greater than 0.
skipClassesNoExact UIView class names whose entire subtree should be pruned
includeChildrenNoInclude child views for the matched view (default false)
includeAncestorsNoInclude ancestor chain for the matched view (default true)
skipClassPrefixesNoClass name prefixes to prune entire subtrees

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changed
    • changedInput schema / properties / fields / description
      Previous 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"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"
    • addedInput schema / properties / hitTest
      Added value: +{
      +  "description": "true returns the view that would receive a touch at the point: it respects userInteractionEnabled, close to UIKit hit-testing. Default false: the deepest visible view.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / maxDepth / description
      Previous value: -"Maximum depth for returned child/ancestor serialization (default 150)"New value: +"Maximum depth for returned child/ancestor serialization (default 150). Must be greater than 0."
    • removedInput schema / properties / maxDepth / maximum
      Removed value: -9007199254740991
    • changedInput schema / properties / x / description
      Previous value: -"Raw X coordinate in points, on the portrait axes of the screen (the axes of native-describe-screen frames). NOT normalized [0,1] tap space."New value: +"Raw X coordinate in points, on the axes of the UI as the user sees it (the axes of screenshots and describe frames). NOT normalized [0,1] tap space."
    • changedInput schema / properties / y / description
      Previous value: -"Raw Y coordinate in points, on the portrait axes of the screen (the axes of native-describe-screen frames). NOT normalized [0,1] tap space."New value: +"Raw Y coordinate in points, on the same axes as x. NOT normalized [0,1] tap space."
  2. Changed3 schema fields changedv0.26.0
    • changedInput schema / properties / fields / description
      Previous value: -"View fields to include. Defaults: pointer, className, tag, frame, windowFrame, bounds, hidden, alpha, opaque, clipsToBounds, userInteractionEnabled, depth, identifier, label, layerName, nativeID. Additional: center, transform, contentMode, backgroundColor, tintColor"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"
    • changedInput schema / properties / x / description
      Previous value: -"Raw X coordinate in the app window's native point space. NOT normalized [0,1] tap space."New value: +"Raw X coordinate in points, on the portrait axes of the screen (the axes of native-describe-screen frames). NOT normalized [0,1] tap space."
    • changedInput schema / properties / y / description
      Previous value: -"Raw Y coordinate in the app window's native point space. NOT normalized [0,1] tap space."New value: +"Raw Y coordinate in points, on the portrait axes of the screen (the axes of native-describe-screen frames). NOT normalized [0,1] tap space."
  3. First observedv0.15.0

TDQS

A4.6/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true, and the description is consistent with that while adding substantial context: the returned shape ({ status, view }), the null cases, and a per-status remediation policy (restart_required vs. service_stale vs. connect_pending vs. init_failed), including the warning not to retry a stale service. It does not discuss cost or performance of deep serialization beyond maxDepth defaults, which keeps it just short of a 5.

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 core question the tool answers, then modes, then return shape, then recovery steps — a sensible ordering. The status-recovery paragraph is dense and would read better as a list, and some phrasing repeats ('follow the message' three times), but nothing is filler.

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?

With no output schema, the description carries the return contract itself and does so precisely: fields of the matched view, ancestry/subview inclusion, and the null conditions. Combined with coordinate-conversion guidance and failure-mode handling, an agent has everything needed to call this correctly and interpret the result without further discovery.

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 meaning the schema does not: hitTest framed as 'visual here?' vs. 'who receives the touch?', and the operational recipe for converting normalized describe frames into the raw x/y this tool expects (multiply by screen size on the same axes). That conversion guidance is exactly the kind of confusion the schema's 'NOT normalized' note only half-prevents.

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 ('Inspect the deepest UIView at a raw native window point') and immediately splits into the two distinct behaviors: the visually-drawn view vs. the hit-test receiver. It also distinguishes itself from the accessibility tree and names native-full-hierarchy as the source of screen size, so an agent can tell exactly what question this tool answers.

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?

Gives explicit triggers for each mode: use hitTest:false when a screenshot shows something the accessibility tree does not name (unlabeled icon, decorative overlay, custom-drawn cell); use hitTest:true when a tap lands somewhere unexpected or does nothing. It names the sibling (native-full-hierarchy) and the exact arguments needed for the coordinate conversion, and states the Apple-system-app exclusion.

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