MCP ServerTools
Impact Detection
Analyze git changes to understand code impact
Analyze your uncommitted changes to see which processes, symbols, and documentation are affected before committing.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
repository | string | Yes | Repository name (e.g., "owner/repo") |
change_scope | string | No | What to analyze (default: "unstaged") |
base_ref | string | No | Base reference for "compare" scope (default: "HEAD") |
include_content | boolean | No | Include symbol code content (default: false) |
max_processes | number | No | Max processes per page (1-50, default: 10) |
max_symbols_per_process | number | No | Max symbols per process (1-100, default: 20) |
page | number | No | Page number for pagination (0-based, default: 0) |
Change Scopes
| Scope | What it compares | Use Case |
|---|---|---|
unstaged | Index vs working tree | See impact before git add |
staged | HEAD vs index | Review before committing |
all | HEAD vs working tree | Full picture of uncommitted work |
compare | base_ref vs working tree | Compare against branch/commit |
For compare scope, you must provide an explicit base_ref (e.g., "main", "develop", or a commit SHA). Using "HEAD" with compare will return an error - use all scope instead.
Usage
Ask your agent:
"What processes are affected by my current changes?"
"Check the impact of my staged changes before I commit"
"Compare my changes against main branch"
Response
{
"summary": {
"changed_symbols_count": 3,
"changed_files_count": 2,
"total_impacted_processes": 5,
"total_impacted_symbols": 12,
"total_lines_changed": 47,
"affected_documents_count": 2,
"message": null
},
"changed_symbols": [
{
"id": "sym_123",
"name": "authenticateUser",
"file_path": "src/auth/login.ts",
"change_type": "Modified"
}
],
"changed_files": [
{
"path": "src/auth/login.ts",
"has_symbols": true,
"symbol_count": 2,
"lines_added": 15,
"lines_deleted": 5
}
],
"impacted_processes": [
{
"id": "proc_456",
"summary": "UserAuthentication",
"entry_point_id": "sym_789",
"symbols": [
{
"id": "sym_123",
"name": "authenticateUser",
"symbol_type": "Function",
"file_path": "src/auth/login.ts",
"is_changed": true,
"step_index": 0,
"centrality_score": 0.85,
"signature": "async function authenticateUser(...)",
"selection_range_start_line": 45,
"selection_range_start_character": 0
}
]
}
],
"affected_documents": [
{
"id": "doc_001",
"title": "Authentication Guide",
"file_path": "docs/auth/README.md",
"preview": "This document explains..."
}
],
"pagination": {
"page": 0,
"page_size": 10,
"total_pages": 1,
"has_more": false
}
}Understanding Results
| Field | Description |
|---|---|
is_changed: true | Symbols you directly modified |
is_changed: false | Symbols in affected processes (potentially impacted) |
affected_documents | Documentation linked to changed symbols (may need updating) |
has_symbols: false | Files with changes but no analyzed code (configs, docs, etc.) |
Empty Results
When no code changes are detected, summary.message explains why:
- No uncommitted changes: Working tree is clean
- No symbols in changed files: Changes are in configs, docs, or unsupported languages
Change Types
| Type | Description |
|---|---|
Modified | Symbol content was changed |
Added | New symbol in a changed file |
Deleted | Symbol removed or file deleted |
Common Workflows
Before staging:
"What's the impact of my unstaged changes?"Before committing:
"Check impact of staged changes"Before creating PR:
"Compare my changes against main branch"Related
- Document Search - Find docs for changed symbols
- Context Search - Search for related code
- Process Resource - Understand affected flows