|
| 1 | +<!-- code-review-graph MCP tools --> |
| 2 | +## MCP Tools: code-review-graph |
| 3 | + |
| 4 | +**IMPORTANT: This project has a knowledge graph. ALWAYS use the |
| 5 | +code-review-graph MCP tools BEFORE using Grep/Glob/Read to explore |
| 6 | +the codebase.** The graph is faster, cheaper (fewer tokens), and gives |
| 7 | +you structural context (callers, dependents, test coverage) that file |
| 8 | +scanning cannot. |
| 9 | + |
| 10 | +### When to use graph tools FIRST |
| 11 | + |
| 12 | +- **Exploring code**: `semantic_search_nodes` or `query_graph` instead of Grep |
| 13 | +- **Understanding impact**: `get_impact_radius` instead of manually tracing imports |
| 14 | +- **Code review**: `detect_changes` + `get_review_context` instead of reading entire files |
| 15 | +- **Finding relationships**: `query_graph` with callers_of/callees_of/imports_of/tests_for |
| 16 | +- **Architecture questions**: `get_architecture_overview` + `list_communities` |
| 17 | + |
| 18 | +Fall back to Grep/Glob/Read **only** when the graph doesn't cover what you need. |
| 19 | + |
| 20 | +### Key Tools |
| 21 | + |
| 22 | +| Tool | Use when | |
| 23 | +|------|----------| |
| 24 | +| `detect_changes` | Reviewing code changes — gives risk-scored analysis | |
| 25 | +| `get_review_context` | Need source snippets for review — token-efficient | |
| 26 | +| `get_impact_radius` | Understanding blast radius of a change | |
| 27 | +| `get_affected_flows` | Finding which execution paths are impacted | |
| 28 | +| `query_graph` | Tracing callers, callees, imports, tests, dependencies | |
| 29 | +| `semantic_search_nodes` | Finding functions/classes by name or keyword | |
| 30 | +| `get_architecture_overview` | Understanding high-level codebase structure | |
| 31 | +| `refactor_tool` | Planning renames, finding dead code | |
| 32 | + |
| 33 | +### Workflow |
| 34 | + |
| 35 | +1. The graph auto-updates on file changes (via hooks). |
| 36 | +2. Use `detect_changes` for code review. |
| 37 | +3. Use `get_affected_flows` to understand impact. |
| 38 | +4. Use `query_graph` pattern="tests_for" to check coverage. |
0 commit comments