Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
xYesLogical X coordinate on device screen
yYesLogical Y coordinate on device screen
portNoMetro server port
maxItemsNoMaximum 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_idYesDevice logicalDeviceId from debugger-connect (iOS simulator UDID or Android logicalDeviceId).
contextLinesNoLines of source context to include around the component definition
includeSkippedNoWhen true, items that would normally be filtered are kept in the response with skipped=true and a skipReason. Useful for understanding what was pruned.
resolveSourceMapsNoWhen 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.
Behavior5/5

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

With no annotations provided, the description fully covers behavioral aspects: it explains the return format (components from tapped element upward with source info), default behavior (35 items, resolveSourceMaps=true), and effect of key parameters (maxItems, resolveSourceMaps, includeSkipped). It also mentions underlying APIs, providing full transparency.

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 well-structured and front-loaded with the core purpose. It uses clear sentences, separates key points into paragraphs, and avoids unnecessary details. Every sentence serves a purpose, making it both concise and informative.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite having no output schema, the description adequately explains what the tool returns (hierarchy items with source file:line and code fragment) and how the items are ordered. For a tool with 8 parameters, the description covers all important aspects: purpose, usage, parameter effects, and failure conditions, making it complete for an AI agent.

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?

The input schema has 100% coverage, and the description adds value beyond the schema by explaining the ordering of returned items for maxItems, the effect of resolveSourceMaps on symbolication, and the purpose of includeSkipped. It does not repeat static schema descriptions but enriches them, earning a score above baseline.

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 defines the tool's purpose: inspecting the React component hierarchy at a given screen coordinate. It specifies the verb 'inspect', the resource 'React component hierarchy', and the coordinate parameters, distinguishing it from sibling tools like debugger-component-tree and native-view-at-point.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description states when to use the tool ('when you need the source file and line for a component at a tap coordinate') and mentions failure conditions (app not connected or coordinate outside screen). It does not explicitly list alternatives, but the context is clear enough for an AI agent to make a decision.

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/software-mansion/argent'

If you have feedback or need assistance with the MCP directory API, please join our Discord server