Dendro React
v0.9.3React codebase semantics for AI agents, with a VS Code visualizer you both share.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_component_tree
Start here for structure. Parses the STATIC IMPORT GRAPH from one entry file and returns the component tree: names, types (functional/class), state variables, parent-child edges. Scope: only components reachable from entryFile via static imports — lazy()/dynamic imports and other entry points are not in the tree, so absence from the tree does not mean absence from the app. Prefer analyze_codebase when you want tree + complexity + context in one call.
| Parameter | Type | Description |
|---|---|---|
entryFile * | string | Absolute path to the entry React component file (e.g., /path/to/App.jsx) |
maxDepth | number | Maximum depth to traverse. Default: unlimited. Large responses are bounded previews with explicit omissions; use a displayed absolutePath as entryFile to expand a branch. |
get_component_details
Get detailed info about a single React component file: type (functional/class), state variables, imports, and direct children. Use after get_component_tree to drill into a specific component.
| Parameter | Type | Description |
|---|---|---|
filePath * | string | Absolute path to the component file |
get_component_contract
Call this BEFORE editing a component — its full contract in one call: props (from the TypeScript type when resolvable, destructuring otherwise), state variables, hooks + contexts read, contexts provided, direct children, who imports it (workspace-wide blast radius with scope disclosed), per-component complexity, and re-render risk count. Resolves by COMPONENT NAME across the workspace (component names, not file basenames — index.tsx exports resolve correctly); pass a file path instead to skip resolution. The notCovered field lists what this deliberately omits (nav edges, per-prop flow, run…
| Parameter | Type | Description |
|---|---|---|
component * | string | Component NAME (e.g. "UserCard") to resolve workspace-wide, or an absolute file path to skip resolution |
searchDir | string | Narrow both name resolution and the used-by scan to this directory. Default: workspace root (complete answer). |
get_modified_components
What changed, as components: every file changed vs a git ref (default HEAD — uncommitted work; pass base:"main" for PR scope) with the components each declares. Call this FIRST when reviewing or testing recent work, then get_component_contract on each result for blast radius — that pair is the "what did I just touch and what depends on it" loop. Changed files with no components still appear (empty components list); deleted files are excluded. Honest errors: not_a_git_repo, bad_ref (unknown or unsafe refs are rejected, never silently swapped for HEAD), and a clean tree says so in the note.
| Parameter | Type | Description |
|---|---|---|
base | string | Git ref to compare against (e.g. "main" for PR scope, a SHA, "HEAD~3"). Default: HEAD — shows uncommitted work (staged + unstaged + untracked). |
workspaceRoot | string | Project root to diff. Default: the workspace root. |
detect_circular_deps
Detect circular import dependencies. Pass the project SOURCE ROOT as a directory for a full scan (scan is capped at depth 5 below rootPath, node_modules excluded — the response discloses the scanned scope, and hasCircularDeps:false only covers that scope). Returns each cycle with its file path and a fix recommendation. To show cycles visually afterwards: open_visualizer + visualize_batch with highlight (red, pulse) steps.
| Parameter | Type | Description |
|---|---|---|
rootPath * | string | Path to scan - can be a single file or a directory. If a directory, scans all .ts/.tsx/.js/.jsx files. |
get_used_by
Find every component that imports the given component — its dependents / reverse dependency graph. Call this BEFORE modifying or renaming a component to measure blast radius; follow with get_prop_flow on affected edges. Scans the workspace root by default (depth ≤ 8, node_modules excluded) and the response reports the exact scope searched. An empty usedBy with workspace-root scope means genuinely unimported (a removal candidate); with a narrower searchDir it is inconclusive — widen and retry.
| Parameter | Type | Description |
|---|---|---|
componentPath * | string | Absolute path to the component file to find usages of |
searchDir | string | Directory to scan. Default: the workspace root (complete answer). Pass a subdirectory only to deliberately narrow the search — importers outside it will be missed. |
get_prop_flow
Trace how a prop flows from a source component down through its children, tracking renames and pass-through HOCs. An empty flow means the prop is missing, never forwarded, or forwarded through a pattern the tracer cannot follow (spreads into unknown components, render props, context) — the response note disambiguates; it does NOT prove the prop is unused. Visualize afterwards with visualize_trace_flow (flowType: "prop").
| Parameter | Type | Description |
|---|---|---|
propName * | string | Name of the prop to trace through the component tree |
sourceFile * | string | Absolute path to the source component file where the prop originates |
maxDepth | number | Maximum depth to trace. Default: 10 |
get_hook_deps
Analyze React hook dependencies in a component file. Returns details about useEffect, useMemo, useCallback, and other hooks including their dependency arrays, classified by source (prop, state, context, ref). Identifies potential issues like missing dependency arrays.
| Parameter | Type | Description |
|---|---|---|
filePath * | string | Absolute path to the React component file to analyze |
get_context_map
Map React Context providers to their consumers: createContext(), Provider usage, useContext(), custom context hooks. Pass the project source root — the scan covers rootPath to depth 5 (node_modules excluded) and zero contexts outside that scope will be missed (the response note says what was scanned). NOT covered: Zustand/Redux/Jotai and other state libraries. Visualize afterwards with visualize_trace_flow (flowType: "context").
| Parameter | Type | Description |
|---|---|---|
rootPath * | string | Path to the root file or directory to scan for Context patterns |
get_screen_components
Map which screens use which components in a React Native codebase. Identifies screens from navigation configuration, screens/ folder, or *Screen suffix. For each screen, traces component imports and builds a usage tree showing all components used. Use maxDepth to limit tree depth for large codebases.
| Parameter | Type | Description |
|---|---|---|
rootPath * | string | Path to the root file or directory to scan for screens and components |
maxDepth | number | Maximum depth to traverse component imports (default: 6, range: 1-12). Lower values produce smaller output for large codebases. |
screenName | string | Optional: filter to a specific screen by name (case-insensitive, partial match) |
get_complexity_report
Score every component's complexity (1-10) from ITS OWN declaration span — lines, JSX depth, props, and hooks are counted per component, so co-located components in one file each get their own accurate score. Use threshold 5+ for moderate issues, 7+ for refactoring candidates. Scope: rootPath scanned to depth 5, node_modules excluded; unparseable files are reported in warnings rather than silently dropped.
| Parameter | Type | Description |
|---|---|---|
rootPath * | string | Path to scan for React components |
threshold | number | Minimum complexity score to include (default: 0) |
get_rerender_risks
Detect React re-render anti-patterns: inline objects/arrays/functions in JSX props, missing useCallback/useMemo. Returns risks by file with severity, line, and fix suggestions. Modern-React aware: when the project uses React Compiler, memoization findings are auto-downgraded to low (the compiler handles them — do NOT add manual memoization there); "use server" files are skipped (server code never re-renders); <form action> handlers are not flagged (React 19 idiom). Read the warnings field — it states every adjustment made.
| Parameter | Type | Description |
|---|---|---|
rootPath * | string | Path to scan — a single file or directory of React components |
minSeverity | string | Minimum severity to include. Default: all severities |
open_visualizer
Open the Dendro visualizer webview in VS Code. Call this ONCE before visualize_batch or visualize_analysis (they can also auto-open by passing an entryFile param). The response reports the parsed tree size — a 1-2 node tree means the entry file is likely a wrapper/layout; pick a higher-fan-out entry instead.
| Parameter | Type | Description |
|---|---|---|
entryFile * | string | Absolute path to the entry React component file (e.g., /path/to/App.tsx) |
visualize_batch
Execute visualization commands sequentially and return correlated node-match/render acknowledgments. success:true means the entire batch was confirmed rendered with no missing targets. Manual walkthroughs return waiting_for_user after the first applied step; later steps have not run. Check progress using action:"status" with the returned requestId. Timeouts, partial matches, skipped/superseded batches and delivery failures are explicit. Always use this instead of parallel individual visual commands. Include labels; waitForUser:true gives users Back/Next/Skip pacing.
| Parameter | Type | Description |
|---|---|---|
action | string | Default: execute. status reads a previous request without dispatching commands. |
commands | array | Required for execute: 1–100 commands to execute sequentially |
delay | number | Auto-play delay between commands in ms (only used when waitForUser is false). Default: 800. |
entryFile | string | Entry file path — if provided and no visualizer is open, auto-opens one |
requestId | string | Required for action:status; use the ID returned by execute. |
sessionId | string | Target specific visualizer session |
timeoutMs | integer | Bounded acknowledgment wait, default 10000 ms. After timeout use action:status; commands may still finish. |
waitForResult | boolean | Default true: wait for completion or a manual pause. false returns queued, which does not establish matching or rendering. |
waitForUser | boolean | Show a "Next" button between commands so user controls pacing. Recommended: true for presentations and audits. |
export_analysis
Export Dendro analysis in one of four formats: "mermaid" (flowchart syntax for docs), "json" (enriched multi-analysis document), "svg" (color-coded diagram image), "markdown" (formatted report — supports persona: developer/ceo/investor/eng-manager/onboarding). Format-specific options are ignored by other formats.
| Parameter | Type | Description |
|---|---|---|
entryFile * | string | Absolute path to the entry React component file |
format * | string | Output format |
analyses | array | json/markdown: which analyses to include. Default: ["tree"] (markdown default depends on persona) |
direction | string | mermaid: graph direction. Default: LR |
maxDepth | number | Maximum depth for tree traversal. Default: unlimited |
persona | string | markdown: target audience — changes formatting, language, structure. Default: developer |
theme | string | svg: color theme. Default: dark |
manage_snapshots
Analysis snapshots for historical tracking, one tool, three actions: "save" (run analyses and store under .dendro/snapshots/ — requires entryFile), "list" (metadata for every saved snapshot), "compare" (diff two snapshots or a snapshot vs "current" live analysis — requires base and target; entryFile required when either side is "current"). Typical loop: save before a refactor, compare base:"<id>" target:"current" after.
| Parameter | Type | Description |
|---|---|---|
action * | string | What to do |
workspaceRoot * | string | Absolute path to the workspace root directory |
analyses | array | save: which analyses to include. Default: ["tree", "complexity", "context"] |
base | string | compare: snapshot ID or "current" |
entryFile | string | save: entry file to analyze (required). compare: required when base or target is "current". |
label | string | save: human-readable label (defaults to filename) |
target | string | compare: snapshot ID or "current" |
verify_state_flows
Verified Projection in one call: generate testable state-flow hypotheses from static analysis, write Jest tests for them, run the tests, and annotate the visualizer tree (green=verified, red=failed, amber=inconclusive). Use stopAfter to run only part of the chain and inspect intermediates: "hypotheses" (static analysis only, no files written), "tests" (also writes Jest files to __dendro__/tests/), "run" (also executes them). Default runs everything including annotation.
| Parameter | Type | Description |
|---|---|---|
entryFile * | string | Absolute path to the entry React component file |
workspaceRoot * | string | Absolute path to the workspace root directory |
clearPrevious | boolean | annotate: clear existing annotations first. Default: true |
flowTypes | array | Which flow types to analyze. Default: all three |
maxHypotheses | number | Maximum hypotheses to generate. Default: 20 |
stopAfter | string | How far to run the chain. Default: annotate (full pipeline) |
timeout | number | Jest execution timeout in ms. Default: 60000 |
batch_analysis
Run multiple analyses across multiple entry files in one call. Returns per-entry results plus aggregate summary (total components, highest complexity, shared contexts). Ideal for monorepos and multi-entry apps.
| Parameter | Type | Description |
|---|---|---|
analyses * | array | Which analyses to run on each entry |
entries * | array | Array of entry files to analyze |
maxDepth | number | Maximum depth for tree traversal. Default: unlimited |
trigger_projection
Diff runtime snapshots and project downstream effects. Call get_runtime_status first. Call once for baseline, then again after a re-render to see what changed and how data flows. Set verify=true to also run Verified Projection.
| Parameter | Type | Description |
|---|---|---|
entryFile * | string | Absolute path to the entry React component file (e.g., /path/to/App.tsx) |
componentName | string | Filter to a specific component by name (case-insensitive, partial match) |
verify | boolean | If true, also run Verified Projection on changed components to annotate verification status |
inspect_live_component
Deep inspect a running component's props, state, hooks, and context values. Call get_runtime_status first to verify connection. Returns real runtime values. Use before modify_runtime_state. Pass diffFromPrevious:true on a SECOND call to get what changed since the last inspection of the same component (props/state/hooks/context deltas) instead of the full snapshot.
| Parameter | Type | Description |
|---|---|---|
componentName * | string | Display name of the component to inspect (case-insensitive, partial match). Must be a user-defined component, not a host element like "View" or "Text". |
diffFromPrevious | boolean | Compare against the previous inspection of this component and return only the deltas. Requires a prior call without this flag (that call is the baseline). |
find_state_owner
Find which component(s) own a given state variable by name. Uses static analysis (getHookDeps) cross-referenced with the live runtime tree to identify mounted components that define the matching useState variable.
| Parameter | Type | Description |
|---|---|---|
stateName * | string | Name of the state variable to search for (case-insensitive, partial match). E.g., "loading", "user", "email" |
entryFile | string | Optional entry file path to scan if no matches found in source-mapped components |
modify_runtime_state
Modify a component's props/state/hooks/context at runtime. Call inspect_live_component first to see current values and identify the right paths. For a simple single-value state change, targetType "state" with the hook index from inspect_live_component is the usual path.
| Parameter | Type | Description |
|---|---|---|
componentName * | string | Display name of the component to modify (case-insensitive, partial match) |
path * | array | Path within the value to modify (e.g., ["user", "name"] for state.user.name). Empty array [] to replace the whole value. |
type * | string | Which part of the component to modify |
value * | New value to set at the path | |
hookID | number | Hook ID for hook state overrides (from inspect_live_component hooks array) |
trace_live_prop
Trace live prop changes through the component tree and animate in the visualizer. Call get_runtime_status first. Call once for baseline, then again after a prop change to see animated flow paths.
| Parameter | Type | Description |
|---|---|---|
componentName * | string | Display name of the component to trace prop flows from (case-insensitive, partial match) |
entryFile * | string | Absolute path to the entry React component file (needed for static analysis) |
propName | string | Specific prop name to trace. If omitted, auto-detects changed props via diff. |
get_runtime_status
Check runtime connection status. MUST call this first before get_live_tree, get_runtime_state, or any live introspection tools. Returns connection status, component count, and setup instructions if disconnected.
get_live_tree
Get the live component tree from a connected React Native app. Call get_runtime_status first to verify connection. Returns the full hierarchy as currently rendered, including component types and parent-child relationships.
| Parameter | Type | Description |
|---|---|---|
includeNative | boolean | Include native/host components like View, Text. Default: true |
maxDepth | number | Maximum depth to return. Default: unlimited |
rootComponent | string | Filter to a specific root component by display name |
get_runtime_state
Find a component in the live runtime tree by name. Call get_runtime_status first to verify connection. Returns source file path, parent, children, and position in the live tree.
| Parameter | Type | Description |
|---|---|---|
componentName * | string | Display name of the component to find (case-insensitive, partial match) |
includeChildren | boolean | Include direct children in the response. Default: true |
get_context_pack
Whole-repo orientation in one dense CTX-PACK/0.1 text block (~200-400 tokens): directory rollups with lines-of-code and 6-month commit heat, the largest and hottest files, cross-directory import edges, and entry-point candidates. The header declares the row schema (D dir, F file, E edge, X entry), so the block is self-describing. Call this FIRST in a new repo — it replaces several exploratory listings with one read. Git unavailable degrades honestly (heat columns 0, noted in a comment).
| Parameter | Type | Description |
|---|---|---|
rootPath | string | Directory to pack (e.g. the project's src/). Default: the workspace root. |
topFiles | number | How many largest files get F rows (default 10). Files with 3+ recent commits are always included. |
get_usage_guide
Get recommended workflows, tool categories, sequencing rules, and tips for using Dendro MCP effectively. Call this once at the start of a session to learn how to use the 36 available tools. Returns structured JSON with workflow recipes and best practices.
submit_feedback
Send a feedback debrief about Dendro to its maker. REQUIRES EXPLICIT USER CONSENT — this is the only Dendro tool that sends anything off-machine, so ask first, every time. Make the invitation warm, not clinical, e.g.: "Want me to send a quick feedback note to Dendro's maker? It's a short debrief of what worked and what fumbled this session — it directly shapes what gets fixed. Nothing is sent unless you say yes, and it never includes your code or file paths." Offer it when tools errored or the user voices an opinion about Dendro; never call it on your own initiative. What is sent: exactly…
| Parameter | Type | Description |
|---|---|---|
summary * | string | 2-5 sentence honest overall assessment of using Dendro this session |
userConsented * | boolean | MUST be true, and only after the user explicitly agreed in this conversation. Passing true without asking the user is a violation of their trust. |
contact | string | Optional contact handle IF the user wants a reply (never fill this without the user providing it) |
fumbles | array | Retries, wrong guesses, confusing responses, dead ends — most valuable field |
hooks | array | Moments the tooling genuinely helped or impressed |
unansweredQuestions | array | THE HIGHEST-VALUE FIELD: React/React Native questions you WANTED answered about this codebase but Dendro could not answer — where you fell back to reading files, grepping, or guessing. Absence is in… |
wouldReuseUnprompted | boolean | Would you reach for Dendro again for a future task in this repo without being told to? |
analyze_codebase
Comprehensive codebase analysis in one call. Runs get_component_tree + get_complexity_report + get_context_map + detect_circular_deps and returns a combined report with summary. Use this instead of calling 4 tools separately. Pass the entry file (e.g., App.tsx) and optionally a root path for directory-level scans.
| Parameter | Type | Description |
|---|---|---|
entryFile * | string | Absolute path to the entry React component file (e.g., /path/to/App.tsx) |
rootPath | string | Root directory for complexity/context/deps scanning. Defaults to the entry file's directory. |
quick_audit
Quick health check for a React codebase. Returns top 5 most complex components, circular dependencies, prop-drilling candidates (5+ props), heavy context providers, effect-hygiene review signals (resources without detected effect cleanup, informational setter-only effects, possible fetch races), unused files nothing imports (dead code — verify before deleting), and an overall health grade (A-F). Baseline support: baseline:"update" records current issues as known; subsequent audits then report NEW issues separately (gate CI on those, not the backlog).
| Parameter | Type | Description |
|---|---|---|
rootPath * | string | Root directory to audit (e.g., /path/to/src/) |
baseline | string | Known-issues baseline at <rootPath>/.dendro/audit-baseline.json. "compare" (default): if a baseline exists, split findings into known vs NEW. "update": write the current findings as the new baseline.… |
visualize_analysis
Open the visualizer and auto-highlight based on analysis focus. Combines open_visualizer + analysis + highlight + annotate + zoom into one call. Focus options: "complexity" (red/orange highlights with scores), "deps" (circular dependency cycles in red with pulse), "context" (providers in purple), "performance" (re-render risks in orange), "all" (everything). Requires VS Code extension.
| Parameter | Type | Description |
|---|---|---|
entryFile * | string | Absolute path to the entry React component file (e.g., /path/to/App.tsx) |
focus | string | Analysis focus to visualize. Default: "all" |
run_workflow
Guided persona-driven analysis playbooks. Returns step-by-step instructions to follow IN ORDER (do not parallelize the tool calls it prescribes). Personas: audit (deep technical audit for React developers), sprint_check (under-200-word health check for engineering managers), ceo_briefing (jargon-free architecture briefing), investor_scorecard (6-category technical due diligence), dev_onboarding (progressive walkthrough for developers joining the project).
| Parameter | Type | Description |
|---|---|---|
entryFile * | string | Absolute path to the entry React component file (e.g., /path/to/App.tsx) |
persona * | string | Which playbook to run |
get_usage_stats
Show local tool usage statistics. Returns invocation counts, first/last used timestamps for each tool. Data is stored locally in ~/.dendro/telemetry.json and never leaves the machine.