get_component_tree
Retrieve React component hierarchy from running React Native apps to analyze UI structure and debug layout issues efficiently.
Instructions
Get the React component tree from the running app. RECOMMENDED: Use focusedOnly=true with structureOnly=true for a token-efficient overview of just the active screen (~1-2KB). This skips navigation wrappers and global overlays, showing only what's actually visible.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| focusedOnly | No | Return only the focused/active screen subtree, skipping navigation wrappers and overlays. Dramatically reduces output size. (Recommended: true) | |
| structureOnly | No | Return ultra-compact structure with just component names (no props, styles, or paths). Use this first for overview, then drill down with inspect_component. | |
| maxDepth | No | Maximum tree depth (default: 25 for focusedOnly+structureOnly, 40 for structureOnly, 100 for full mode) | |
| includeProps | No | Include component props (excluding children and style). Ignored if structureOnly=true. | |
| includeStyles | No | Include layout styles (padding, margin, flex, etc.). Ignored if structureOnly=true. | |
| hideInternals | No | Hide internal RN components (RCTView, RNS*, Animated, etc.) for cleaner output (default: true) | |
| format | No | Output format: 'json' or 'tonl' (default, compact indented tree). Ignored if structureOnly=true. | tonl |