debugger-inspect-element
Inspect the React component hierarchy at an (x, y) screen point, returning components from the tapped element upward with source file, line, and code fragment for debugging.
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). Use when you need the source file and line for a component at a point. Convert fractions from debugger-component-tree using the width and height in its Screen line. Fails if the app is disconnected or the point is outside the screen.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"device_id": "<device_id>",
"x": "<x>",
"y": "<y>"
},
"name": "debugger-inspect-element"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | Yes | Horizontal position in logical pixels from the left edge of the screen. | |
| y | Yes | Vertical position in logical pixels from the top edge of the screen. | |
| port | No | Metro port. Omit it to use this device's port (8081 by default). Ignored for Chromium, whose CDP port is in device_id. Range: 1 to 65535. | |
| maxItems | No | Maximum number of hierarchy items to return, most specific first. The default covers all app-specific code; increase to 70+ to also see the navigation/screen structure. Default: 35. | |
| device_id | Yes | Device id used with debugger-connect. | |
| contextLines | No | Lines of source context to include around the component definition. Default: 3. | |
| includeSkipped | No | When true, items that would normally be filtered are kept in the response with skipped=true and a skipReason. Default: false. | |
| 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 a code fragment. Default: true. |