Skip to main content
Glama

Get component tree

get_component_tree

Inspect a depth-limited React Native component tree with testID and text labels, counting only authored components and omitting host wrappers and dev-only UI.

Instructions

Depth-limited React component tree via the React DevTools hook, with testID and text where present. max_depth counts only components a developer actually authored — host components (RCTView, RCTText, ...) and structural wrappers (forwardRef/memo/context, styling HOCs) are free and can repeat any number of times without spending budget. RN's own dev-only infrastructure (LogBox, the debugging overlay, the root tag context) is omitted from the output entirely. Large trees are capped and marked truncated rather than returned unbounded.

Input Schema

NameRequiredDescriptionDefault
max_depthNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it defines what counts against budget, states that LogBox/overlay/root-tag-context nodes are omitted entirely, and that oversized trees are capped and flagged truncated rather than returned unbounded. What it leaves out is failure behavior — what happens if the React DevTools hook isn't present — and required app/connection state.

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?

Three sentences, front-loaded with the purpose, then parameter semantics, then output filtering and truncation. Parenthetical examples are dense but each earns its place; there is no filler or restatement of the 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 single-parameter read tool with no output schema and no annotations, it covers content of the returned nodes, exclusions, and truncation marking. The remaining gap is the response shape (nested tree vs flat list of nodes) and the runtime precondition for the DevTools hook, which an agent would need before calling.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate, and it does: max_depth is explained as counting only developer-authored components, with host components, forwardRef/memo/context and styling HOCs explicitly free and repeatable. That is a real semantic rule an agent could not derive from the bare integer schema with a 1–10 range.

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+resource: a depth-limited React component tree obtained via the React DevTools hook, enriched with testID and text. The resource is distinct enough from neighbors like get_layout or read_screen_text to be selectable, but the description never names a sibling or explicitly contrasts itself with them.

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?

Usage is only implied: an agent can infer this is for inspecting the React component hierarchy on a connected RN app, and that dev-only infrastructure is filtered out. There is no explicit 'use this when…' or 'prefer X instead' guidance, and no mention of prerequisites such as the DevTools hook being available or the app running in dev mode.

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