Skip to content

Reference

cdp_component_tree

Get React component tree. Returns components with props, state, testIDs. Use filter to scope to a specific subtree — NEVER request full tree unless necessary (saves tokens). Detects RedBox and warns. Pass interactiveOnly=true for a compact “what can I act on here?” digest (only tappable/editable elements + their text, no props/state) — the cheapest way to perceive a novel screen for live interaction.

NameTypeRequiredDefaultConstraintsDescription
filterunknownNo
depthnumberNo4min: 1, max: 12, integerMax depth (default 4, max 12)
interactiveOnlyunknownNo
cdp_component_tree()