debugger-inspect-element
Inspect the React component hierarchy at a specific screen coordinate to find the source file and line number of the component under that point.
Instructions
Inspect the React component hierarchy at a screen coordinate (x, y). Returns components from the tapped element upward through its parent hierarchy, each with its source file:line and a code fragment.
The first items (lowest indices) are the most specific — the exact component under the tap point and its direct parents. Higher indices are broader context (page, navigator). Default shows 35 items which covers all app-specific code; use maxItems=70+ to also see the navigation/screen structure.
Uses getInspectorDataForViewAtPoint + _debugStack + Metro /symbolicate. Set resolveSourceMaps to false to skip symbolication and get raw bundled locations instead. Set includeSkipped=true to see filtered items annotated with skip reasons. Use when you need the source file and line for a component at a tap coordinate. Fails if the app is not connected or the coordinate is outside the screen.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | Logical X coordinate on device screen | |
| y | Yes | Logical Y coordinate on device screen | |
| port | No | Metro server port | |
| maxItems | No | Maximum number of hierarchy items to return, counted from the bottom (most specific component first). The hierarchy walks from the tapped element up to the root — the first items are the most relevant for editing. Increase to 70+ if you need to understand the broader navigation/screen structure. | |
| device_id | Yes | Device logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId). | |
| contextLines | No | Lines of source context to include around the component definition | |
| includeSkipped | No | When true, items that would normally be filtered are kept in the response with skipped=true and a skipReason. Useful for understanding what was pruned. | |
| resolveSourceMaps | No | When true, resolves bundled frame locations to original source files via Metro symbolication and includes a code fragment. When false, returns the raw bundled frame info (file, line, column) without symbolication or source reading. |