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
Behavior4/5

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

Since no annotations are provided, the description carries the full burden of behavioral disclosure. It effectively describes the tool's behavior regarding output size reduction, what gets skipped (navigation wrappers and global overlays), and token efficiency considerations. It doesn't mention rate limits, authentication needs, or error conditions, but provides substantial operational context.

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?

The description is perfectly concise with just two sentences, both of which earn their place. The first sentence states the core purpose, and the second provides crucial usage guidance with specific recommendations and quantitative benefits. No wasted words or redundant information.

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 tool with 7 parameters, 100% schema coverage, and no output schema, the description provides excellent context about usage patterns and practical considerations. It could potentially mention return format details or error cases, but given the comprehensive schema and clear behavioral guidance, it's nearly complete for agent understanding.

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?

With 100% schema description coverage, the baseline would be 3, but the description adds significant value by explaining the interaction between parameters (focusedOnly=true with structureOnly=true) and the practical impact on output size (~1-2KB), which goes beyond the schema's technical documentation of individual parameters.

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?

The description clearly states the tool's purpose with specific verb ('Get') and resource ('React component tree from the running app'), distinguishing it from sibling tools like inspect_component or find_components by focusing on the entire tree structure rather than individual components or search operations.

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?

The description provides explicit guidance on when to use this tool, recommending specific parameter combinations (focusedOnly=true with structureOnly=true) for token-efficient overviews, and mentions an alternative (drill down with inspect_component) for detailed inspection after getting the overview.

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

Install Server

Other Tools

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