Skip to main content
Glama
react-native-devtools-mcp

react-native-devtools-mcp

get_view_hierarchy

Retrieves the current UI accessibility hierarchy with labels, types, frames, and testIDs, enabling you to inspect and filter React Native app elements.

Instructions

Dump the current UI accessibility tree with labels, types, frames, and testIDs. Requires Facebook IDB on iOS.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "get_view_hierarchy"
  }
}

Input Schema

NameRequiredDescriptionDefault
filterNoFilter elements by label, testID, value, or type
formatNoOutput format: raw (JSON on iOS, XML on Android) or formatted tree (default: tree)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It usefully discloses the external dependency (Facebook IDB on iOS), but does not state that the operation is read-only, what happens when IDB is unavailable, or that full-tree dumps can be large/slow.

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?

Two sentences, front-loaded with the action and output, followed by the single hard prerequisite. No filler or redundant restatement of the tool name.

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 simple 2-optional-param read tool with no output schema, listing the fields emitted partially substitutes for missing return documentation, and the platform caveat is present. Minor gaps: no mention of the raw vs tree format choice or failure behavior when IDB is absent.

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 filter and format are already fully documented in the schema (including the enum and default). The description's list of labels/types/frames/testIDs loosely maps to what the filter matches, but adds no format or syntax detail beyond the schema.

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?

States a specific verb and resource ("Dump the current UI accessibility tree") and names the returned content (labels, types, frames, testIDs), which distinguishes it from visual siblings like screenshot. It does not explicitly contrast itself with siblings such as screenshot or get_device_info, but the purpose is unambiguous.

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?

Implied usage is clear (inspect the accessibility tree to locate elements for tap/press_button/type_text), and the iOS prerequisite "Requires Facebook IDB on iOS" is a genuine usage condition. However, it never states when to prefer this over screenshot, nor what to do on Android beyond the schema's format note.

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