Skip to main content
Glama

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
NameRequiredDescriptionDefault
focusedOnlyNoReturn only the focused/active screen subtree, skipping navigation wrappers and overlays. Dramatically reduces output size. (Recommended: true)
structureOnlyNoReturn ultra-compact structure with just component names (no props, styles, or paths). Use this first for overview, then drill down with inspect_component.
maxDepthNoMaximum tree depth (default: 25 for focusedOnly+structureOnly, 40 for structureOnly, 100 for full mode)
includePropsNoInclude component props (excluding children and style). Ignored if structureOnly=true.
includeStylesNoInclude layout styles (padding, margin, flex, etc.). Ignored if structureOnly=true.
hideInternalsNoHide internal RN components (RCTView, RNS*, Animated, etc.) for cleaner output (default: true)
formatNoOutput format: 'json' or 'tonl' (default, compact indented tree). Ignored if structureOnly=true.tonl

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/igorzheludkov/metro-logs-mcp'

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