You've got CodeGraph MCP installed and a graph built. Here's where to go next.
Understand the model
- How It Works — the extraction → storage → resolution → sync pipeline.
- The Knowledge Graph — the node and edge kinds the graph is built from.
- Runtime Telemetry Reconciliation — reconciling static AST edges against live recorded traces.
- Database Lineage & Schema — tracing mutating SQL writers, columns, and ORM models.
- Resolution & Frameworks — how references and framework routes get connected.
Put it to work
- Indexing a Project — full index, incremental sync, and the file watcher.
-
Reading Your Graph in the Browser —
codegraph ui: callers, source and callees on one screen. - Git-Aware Intelligence & Merge Conflicts — AST diffs, impact trees, and pre-merge contract conflicts.
- Framework Routes — link URL patterns to their handlers.
- Affected Tests in CI — run only the tests a change touches.
- Database Schema & Writers — find all tables, models, and mutating SQL queries.
- MCP Tools Reference — 82 verified tools exposed over Model Context Protocol.
Introduction
CodeGraph MCP is a deterministic, local-first code-intelligence engine for AI coding agents. Instead of letting agents waste context tokens repeatedly running grep, find, and reading hundreds of random files, CodeGraph MCP pre-indexes the structural relationships of a repository.
It parses code locally using Tree-sitter to deterministically extract symbols, definitions, class hierarchies, import chains, and function call relationships. The extracted graph is stored local-first inside a project-level SQLite database with WAL mode and FTS5 full-text search.
Quickstart
Install CodeGraph MCP from PyPI with complete CLI and FastMCP server bindings:
pip install "codegraph-engine[mcp]"
Initialize and index your repository:
cd /path/to/project codegraph init . codegraph index . codegraph status .
Configuration
Add CodeGraph MCP to Claude Code, Cursor, Windsurf, or Antigravity via your standard MCP config:
{
"mcpServers": {
"codegraph": {
"command": "codegraph",
"args": ["serve", "."]
}
}
}
How It Works
CodeGraph MCP operates through a deterministic four-phase pipeline:
- Tree-sitter Parsing: Source files are parsed incrementally into concrete ASTs. Zero LLM hallucinations.
- Relational Graph Storage: Symbols, calls, imports, and routes are stored in SQLite with foreign-key constraints.
- Deterministic Resolution: Canonical IDs, qualified names, and route endpoints are resolved with explicit ambiguity states.
- MCP Tool Serving: FastMCP stdio/SSE server serves 82 verified tools with token-bounded context packets.
Git-Aware Repository Intelligence & Merge Conflict Safety (v3.0.1)
CodeGraph MCP v3.0.1 understands how the repository changed across branches and commits, what those changes affect, and whether previously generated context is still valid.
- Working-Tree Freshness: Sub-5ms detection of branch, HEAD, indexed commit, and dirty modifications (
codegraph git-state). - Structural AST Diff: Semantic analysis of added, removed, and modified functions, parameters, and routes (
codegraph git-diff [base] [head]). - Visual Downstream Impact Tree: ASCII tree visualization mapping affected callers, routes, tests, and database writers (
codegraph git-impact --tree). - Pre-Merge Semantic Conflict Detection: Detect contract breaks before pull requests merge (
codegraph git-conflicts main HEAD). - Context Freshness Validation: Guarantees that AI agent context packets stay valid when unrelated files change (
codegraph check-freshness). - Deterministic Symbol History: Exact commit provenance for symbols across git log (
codegraph symbol-history <symbol>).
Runtime Telemetry Reconciliation
Static analysis alone cannot detect runtime dynamic dispatch, monkey-patching, or live test coverage. CodeGraph MCP reconciles static AST graph edges against recorded runtime execution traces.
RUNTIME_OBSERVED edges. If a static path is not triggered during tests, it is flagged as NOT_OBSERVED_AT_RUNTIME without claiming it cannot execute.
Database Lineage & Schema Intelligence
CodeGraph MCP indexes relational databases, migrations, and ORMs (SQLAlchemy, Prisma, Django ORM). It connects tables and columns to the exact Python or TypeScript functions that read or write them.
INSERT, UPDATE, or DELETE queries before performing breaking database migrations.
Indexing a Project
Run codegraph index . to scan and parse all files in your repository. Incremental indexing utilizes content hashes so subsequent runs finish in milliseconds.
Interactive Web Knowledge Graph Dashboard (codegraph ui)
Launch the local interactive visualizer with codegraph ui to explore callers, callees, full-stack routes, and database relationships in real-time directly in your browser:
codegraph ui --port 8765
The dashboard includes a force-directed knowledge graph, full-stack route tree, database lineage matrix (Prisma, Drizzle, SQLAlchemy, Mongoose), PR blast radius explorer, and live REST/SSE endpoints.
Official VS Code Extension
The official CodeGraph VS Code extension brings deterministic repository intelligence right into your code editor. It adds:
- Full-Stack Route Explorer: Activity bar tree displaying all Next.js, FastAPI, Flask, Express, and NestJS endpoints with one-click jump-to-definition.
- Database Lineage & Models: Side-by-side inspection of tables, fields, readers, and writers.
- PR Blast Radius Tree: Instant risk score, downstream callers, and targeted test command for the current active file.
- In-Editor Visual Knowledge Graph: Interactive dashboard opened inside a native VS Code Webview panel.
- Safe AST Rename: Deterministic symbol refactoring across all callers and route handlers.
Framework Routes
CodeGraph MCP automatically traces routes for FastAPI, Flask, Django, Express.js, and NestJS, connecting HTTP verbs and path templates directly to their handler symbols.
Affected Tests in CI
Use find_related_tests to discover the exact subset of unit and integration tests covering a modified symbol, optimizing continuous integration test run times.
Database Schema & Writers
Query find_db_tables, find_db_columns, and find_db_writers to audit data flow before performing database refactors.
MCP Tools Reference (82 Verified Tools)
Every tool exposed by CodeGraph MCP over Model Context Protocol, categorized into Git Intelligence, Database, Runtime, Graph, Core, Routes, and Tests.
Git-Aware Intelligence & Change Impact Tools (9)
Working-tree freshness, AST-level git diffs, semantic merge conflicts, symbol history, and blast-radius impact.
Compute deterministic change impact between Git refs (`base`..`head`), including modified symbols, downstream callers, affected packages, and covering tests. Use for PR review, regression analysis, and pre-commit blast-radius checks. Does not execute tests; reports static test-to-symbol coverage edges.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| base | string | Optional | HEAD~1 | Base |
| head | string | Optional | HEAD | Head |
get_git_impact(base="HEAD~1", head="HEAD")
GitImpactResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| base | string | Base |
| head | string | Head |
| changed_files | array | Changed Files |
| modified_symbols | array | Modified Symbols |
| impacted_callers | array | Impacted Callers |
| affected_packages | string | Affected Packages |
| related_tests | array | Related Tests |
Return repository files modified between two Git refs (`since`..`until`) in a read-only sandboxed query. Use when reviewing recent commits or identifying which files changed before running impact analysis. Does not compute downstream symbol callers; use get_git_impact for symbol-level blast radius.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| since | string | Optional | HEAD~10 | Since |
| until | string | Optional | HEAD | Until |
get_recent_changes(since="HEAD~5", until="HEAD")
GitChangedFilesList| Field | Type | Description |
|---|---|---|
| path | string | Path |
| status | string | Status |
Return recent Git commits touching a specific repository file (`path`, up to `n` commits). Use when investigating when and why a specific file was recently modified. Does not return full commit diffs or cross-file dependency impact.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| path | string | Required | - | Path |
| n | integer | Optional | 10 | N |
get_file_history(path="src/auth/service.py", n=5)
FileCommitHistoryList| Field | Type | Description |
|---|---|---|
| commit | string | Commit |
| author | string | Author |
| date | string | Date |
| subject | string | Subject |
Analyze changed files, modified symbols, downstream callers, and related tests between Git refs `since` and `until`. Use for commit-range impact analysis when `since`/`until` parameter naming is preferred. Does not execute tests at runtime.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| since | string | Optional | HEAD~1 | Since |
| until | string | Optional | HEAD | Until |
analyze_change_impact(since="HEAD~2", until="HEAD")
ChangeImpactReport| Field | Type | Description |
|---|---|---|
| changed_files | array | Changed Files |
| modified_symbols | array | Modified Symbols |
| callers | array | Callers |
| related_tests | array | Related Tests |
Track current Git branch, HEAD commit, indexed commit, working tree modifications, staged files, and explicit freshness states (CLEAN, DIRTY, STALE, REINDEXING, ERROR). Use when asking if the index is up to date, which files changed, or what git branch is active. Does not perform a full repository scan when an incremental update is safe.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| No arguments required. | ||||
get_git_state()
GitStateReport| Field | Type | Description |
|---|---|---|
| is_git | string | Is Git |
| branch | string | Branch |
| current_head | string | Current Head |
| indexed_head | string | Indexed Head |
| freshness | boolean | Freshness |
| working_tree | string | Working Tree |
| reindex_required | string | Reindex Required |
| detail | string | Detail |
Compare two Git revisions, commits, or branches structurally. Detects added/deleted/modified/renamed files, AST symbol changes, relationship diffs, routes, and affected tests. Use when comparing branches or commits structurally. Does not execute repository code.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| base | string | Optional | HEAD~1 | Base |
| head | string | Optional | HEAD | Head |
| branch_comparison | boolean | Optional | False | Branch Comparison |
compare_git(base="main", head="HEAD", branch_comparison=True)
StructuralDiffResult| Field | Type | Description |
|---|---|---|
| base_ref | string | Base Ref |
| head_ref | string | Head Ref |
| added_files | array | Added Files |
| deleted_files | array | Deleted Files |
| modified_files | array | Modified Files |
| renamed_files | array | Renamed Files |
| added_symbols | array | Added Symbols |
| removed_symbols | array | Removed Symbols |
| changed_symbols | array | Changed Symbols |
| changed_routes | array | Changed Routes |
| affected_tests | array | Affected Tests |
Compute deep downstream change impact across callers, callees, framework routes, covering tests, mutating database queries, and monorepo packages. Returns ranked entities with explicit confidence (FACT, POSSIBLE, UNKNOWN) and blast radius score. Use when evaluating ripple effects of git commits. Does not execute repository test suites.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| base | string | Optional | HEAD~1 | Base |
| head | string | Optional | HEAD | Head |
| max_depth | integer | Optional | 2 | Max Depth |
| max_results | integer | Optional | 50 | Max Results |
get_change_impact(base="HEAD~1", head="HEAD")
DeepImpactResult| Field | Type | Description |
|---|---|---|
| base_ref | string | Base Ref |
| head_ref | string | Head Ref |
| changed_files | array | Changed Files |
| changed_symbols | array | Changed Symbols |
| direct_callers | array | Direct Callers |
| transitive_callers | array | Transitive Callers |
| affected_routes | array | Affected Routes |
| affected_tests | array | Affected Tests |
| db_writers | array | Db Writers |
| blast_radius_score | string | Blast Radius Score |
Validate whether a previously compiled context packet or task context is still VALID, PARTIALLY_STALE, or STALE. Guarantees that changes to unrelated files keep context VALID. Use when checking if previously compiled context remains valid after edits. Does not invalidate context when only unrelated files change.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| task | string | Optional | Task | |
| context_packet | any | Optional | None | Context Packet |
check_context_freshness(task="Fix auth timeout")
ContextFreshnessResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| base_commit | string | Base Commit |
| current_head | string | Current Head |
| repository_dirty | string | Repository Dirty |
| context_files | array | Context Files |
| changed_relevant_files | array | Changed Relevant Files |
| unrelated_changed_files | array | Unrelated Changed Files |
| invalidated_symbols | array | Invalidated Symbols |
| reason | string | Reason |
| recommended_action | string | Recommended Action |
Trace deterministic symbol evolution across Git history: introduced, modified, moved across files, renamed, or deleted. Uses AST structure and body hashes to differentiate FACT from POSSIBLE/AMBIGUOUS renames. Use when discovering when a symbol was added, moved, or renamed. Does not guess ambiguous renames without evidence.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| symbol | string | Required | - | Symbol |
| path | string | Optional | Path | |
| max_commits | integer | Optional | 15 | Max Commits |
trace_symbol_history(symbol="AuthService")
SymbolHistoryResult| Field | Type | Description |
|---|---|---|
| symbol | string | Symbol |
| current_path | string | Current Path |
| events | string | Events |
| total_commits_evaluated | string | Total Commits Evaluated |
| status | string | Status |
| detail | string | Detail |
Database Lineage & Schema Tools (11)
Tools for table inspection, column typing, mutating SQL writers, and schema impact analysis.
Find database tables discovered across ORM models, raw SQL queries, and migrations. Use instead of grep when asking which database tables exist in this repository. Returns canonical IDs (`db.<dialect>.<schema>.<table>`), columns, ORM models, and evidence classes (`FRAMEWORK_VERIFIED`, `STATIC_VERIFIED`, `POSSIBLE`, `UNKNOWN`). Does not connect to live databases or execute SQL.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| table | string | Optional | Table | |
| dialect | string | Optional | Dialect | |
| schema | string | Optional | Schema |
find_db_tables()
DatabaseTableListResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| tables | array | Tables |
| count | integer | Count |
Find database columns, data types, nullability, primary keys, and foreign keys across tables and ORM models. Use instead of grep when locating where a table column is defined or mapped (`MAPS_TO_COLUMN`, `HAS_PRIMARY_KEY`, `FOREIGN_KEY_TO`). Returns column definitions and source coordinates. Does not inspect live database catalogs.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| table | string | Optional | Table | |
| column | string | Optional | Column |
find_db_columns(table="bills")
DatabaseColumnListResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| columns | array | Columns |
| count | integer | Count |
Find ORM models (SQLAlchemy, Flask-SQLAlchemy, Django ORM, SQLModel, Prisma) and their `MAPS_TO_TABLE` mappings. Use when asking which model class maps to a database table or vice versa. Returns model name, table, canonical ID, and `FRAMEWORK_VERIFIED` evidence. Does not import or execute application model modules.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| model | string | Optional | Model | |
| table | string | Optional | Table |
find_db_models(table="products")
DatabaseModelListResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| models | string | Models |
| count | integer | Count |
Find database queries (`SELECT`, `INSERT`, `UPDATE`, `DELETE`) across ORM calls, query builders, and raw SQL strings. Use when asking which queries touch a table or what SQL a function executes. Returns `READS_TABLE`, `WRITES_TABLE`, `POSSIBLE_TABLE`, or `UNKNOWN_TABLE` with redacted snippets. Never exposes SQL literal secret parameters.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| table | string | Optional | Table | |
| symbol | string | Optional | Symbol | |
| operation | string | Optional | Operation |
find_db_queries(table="orders")
DatabaseQueryListResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| queries | array | Queries |
| count | integer | Count |
Find all functions, methods, and upstream HTTP routes (`HANDLED_BY`) that read from or write to a database table. Use instead of grep when asking which code or route reaches a table. Returns direct accessors, upstream routes, relationships (`READS_TABLE`, `WRITES_TABLE`), and evidence classes. Does not prove runtime query frequency.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| table | string | Required | - | Table |
find_db_callers(table="products")
DatabaseCallersResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| table | string | Table |
| direct_accessors | string | Direct Accessors |
| upstream_routes | array | Upstream Routes |
| count | integer | Count |
Find all symbols and queries that write (`INSERT`, `UPDATE`, `DELETE`) to a database table or column (`WRITES_TABLE`, `WRITES_COLUMN`). Use when investigating data mutations, state changes, or write blast radius. Returns writer symbols, operations, file:line citations, and redacted snippets. Does not execute database transactions.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| table | string | Optional | Table | |
| column | string | Optional | Column |
find_db_writers(table="products")
DatabaseWritersResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| writers | array | Writers |
| count | integer | Count |
Find all symbols and queries that read (`SELECT`, `.query()`, `.objects.filter()`, `.findMany()`) from a database table or column (`READS_TABLE`, `READS_COLUMN`). Use when tracing where table data is consumed across services and views. Returns reader symbols, operations, and evidence classes. Does not prove runtime cache hits.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| table | string | Optional | Table | |
| column | string | Optional | Column |
find_db_readers(table="users")
DatabaseReadersResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| readers | array | Readers |
| count | integer | Count |
Find database schema and ORM relationships (`FOREIGN_KEY_TO`, `ORM_RELATION`, `MAPS_TO_TABLE`, `HAS_PRIMARY_KEY`, `HAS_INDEX`, `MIGRATES_TABLE`). Use when inspecting foreign keys, table joins, or model associations. Preserves explicit database relationship types and never collapses them into generic `DEPENDS_ON`.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| table | string | Optional | Table |
find_db_relationships(table="orders")
DatabaseRelationshipsResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| relationships | string | Relationships |
| count | integer | Count |
Return complete structural details for a database table including columns, primary keys, foreign keys, indexes, constraints, ORM models, readers, writers, migrations, and upstream routes. Use when inspecting a specific table's schema and code usage in one call. Does not query live database servers.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| table | string | Required | - | Table |
get_db_table(table="products")
DatabaseTableDetailResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| table | string | Table |
| canonical_id | string | Canonical Id |
| dialect | string | Dialect |
| schema | string | Schema |
| columns | array | Columns |
| primary_keys | string | Primary Keys |
| foreign_keys | string | Foreign Keys |
| indexes | string | Indexes |
| orm_models | string | Orm Models |
| readers | array | Readers |
| writers | array | Writers |
| migrations | string | Migrations |
| upstream_routes | array | Upstream Routes |
Return a repository-wide database schema summary including all discovered tables, columns, ORM models, foreign keys, and migrations. Use for database architecture overviews or schema audits. Preserves `UNKNOWN` dialect and schema when not statically provable and never guesses database names.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| dialect | string | Optional | Dialect | |
| schema | string | Optional | Schema |
get_db_schema()
DatabaseSchemaOverviewResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| dialects | string | Dialects |
| schemas | string | Schemas |
| tables | array | Tables |
| orm_models | string | Orm Models |
| foreign_keys | string | Foreign Keys |
| migrations | string | Migrations |
| env_variables | string | Env Variables |
Compute bidirectional Code <-> Database change impact for a table or column, returning affected ORM models, readers, writers, upstream HTTP routes, migrations, and statically linked tests. Use before renaming or altering a database table or column. Does not execute database migrations or tests.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| table | string | Optional | Table | |
| column | string | Optional | Column |
get_db_impact(table="products", column="shop_id")
DatabaseImpactResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| table | string | Table |
| column | string | Column |
| affected_models | string | Affected Models |
| affected_readers | array | Affected Readers |
| affected_writers | array | Affected Writers |
| affected_routes | array | Affected Routes |
| affected_migrations | string | Affected Migrations |
| affected_tests | array | Affected Tests |
Runtime Telemetry & Reconciliation Tools (6)
Tools for execution trace recording, runtime observation reconciliation, and dynamic call tracing.
Compute deterministic multi-hop relationship paths between two symbols (`from_symbol` -> `to_symbol`). Use when tracing how an entrypoint, route, or caller reaches a downstream service or database function. Returns ordered hop edges with relationship types and evidence classes. Does not prove runtime branch conditions along the path.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| from_symbol | string | Optional | From Symbol | |
| to_symbol | string | Optional | To Symbol | |
| start_symbol | string | Optional | Start Symbol | |
| target_symbol | string | Optional | Target Symbol | |
| source_symbol | string | Optional | Source Symbol | |
| max_depth | integer | Optional | 5 | Max Depth |
trace_path(from_symbol="login_endpoint", to_symbol="find_by_email", max_depth=4)
PathTraceResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| from_symbol | string | From Symbol |
| to_symbol | string | To Symbol |
| path | string | Path |
| paths | string | Paths |
| hops | string | Hops |
| evidence_class | string | Evidence Class |
| confidence | string | Confidence |
Traverse callers, callees, or both from a single `symbol` (`canonical_id` supported as alias) up to `depth` with confidence and relationship labels. Use when exploring upstream and/or downstream call trees from one symbol without a known second endpoint. Does not prove runtime branch execution.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| symbol | string | Optional | Symbol | |
| canonical_id | string | Optional | Canonical Id | |
| depth | integer | Optional | 2 | Depth |
| callers | boolean | Optional | True | Callers |
| callees | boolean | Optional | False | Callees |
| both | boolean | Optional | False | Both |
trace_call(symbol="verify_password", depth=2, callers=True)
DirectionalCallTraceList| Field | Type | Description |
|---|---|---|
| source | string | Source |
| target | string | Target |
| relationship | string | Relationship |
| confidence | string | Confidence |
| evidence_class | string | Evidence Class |
| depth | integer | Depth |
| file | string | File |
| start_line | integer | Start Line |
Trace multi-hop upstream callers and downstream callees around a single symbol (`symbol`; `canonical_id` supported as alias) up to `depth`. Use when exploring bidirectional execution flow around a function or handler without a known second endpoint. Does not prove runtime branch execution; use trace_path when both endpoints are known.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| symbol | string | Optional | Symbol | |
| canonical_id | string | Optional | Canonical Id | |
| depth | integer | Optional | 2 | Depth |
| callers | boolean | Optional | True | Callers |
| callees | boolean | Optional | False | Callees |
| both | boolean | Optional | False | Both |
trace_flow(symbol="place_order", depth=2)
DirectionalCallTraceList| Field | Type | Description |
|---|---|---|
| source | string | Source |
| target | string | Target |
| relationship | string | Relationship |
| confidence | string | Confidence |
| evidence_class | string | Evidence Class |
| depth | integer | Depth |
| file | string | File |
| start_line | integer | Start Line |
Ingest optional runtime observation traces (OpenTelemetry JSON, structured JSON/JSONL events, or SQL query logs) into CodeGraph's `RUNTIME_OBSERVED` layer. Use when grounding static analysis with recorded runtime traces. Automatically strips headers/cookies/bodies, redacts SQL bind parameters and secrets, and never converts runtime observations into static `AST_VERIFIED` proof.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| source_path | string | Optional | Source Path | |
| format | string | Optional | auto | Format |
| payload | string | Optional | Payload | |
| max_events | integer | Optional | 5000 | Max Events |
| sample_rate | number | Optional | 1.0 | Sample Rate |
ingest_runtime_traces(source_path="traces/scan_bill.json")
RuntimeIngestResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| runtime_generation | string | Runtime Generation |
| events_ingested | string | Events Ingested |
| edges_recorded | array | Edges Recorded |
| redacted_fields | string | Redacted Fields |
Retrieve aggregated runtime execution edges (`RUNTIME_OBSERVED`) and reverse maps (`table -> runtime writers/readers`, `route -> runtime tables`) with `observation_count`, `first_seen`, `last_seen`, and `runtime_generation`. Use when asking what actually happened at runtime. Does not treat unobserved paths as impossible.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| route | string | Optional | Route | |
| symbol | string | Optional | Symbol | |
| table | string | Optional | Table |
get_runtime_trace(route="/api/scan-bill")
RuntimeTraceResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| edges | array | Edges |
| observations | string | Observations |
| reverse_maps | string | Reverse Maps |
| count | integer | Count |
Reconcile static repository edges against ingested runtime observations, classifying edges into `CONFIRMED_RUNTIME_PATH`, `STATIC_RUNTIME_CONFLICT`, `NOT_OBSERVED_AT_RUNTIME`, and `RUNTIME_ONLY_OBSERVED`. Use when comparing static code analysis with runtime behavior. Never treats `NOT_OBSERVED_AT_RUNTIME` as proof that a path cannot execute.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| symbol | string | Optional | Symbol | |
| route | string | Optional | Route | |
| table | string | Optional | Table |
reconcile_static_runtime(route="/api/scan-bill")
StaticRuntimeReconciliationResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| confirmed_runtime_paths | string | Confirmed Runtime Paths |
| static_runtime_conflicts | string | Static Runtime Conflicts |
| not_observed_at_runtime | boolean | Not Observed At Runtime |
| runtime_only_observed | boolean | Runtime Only Observed |
| summary | string | Summary |
Graph Traversal & Call Hierarchy Tools (12)
Directional call hierarchies, caller/callee graphs, and change impact propagation.
Return statically verified callers of a symbol with confidence and evidence_class. Primary input: `symbol` (also accepts `canonical_id` as a compatibility alias using the exact same resolution path). Use for multi-file call-relationship and upstream impact questions. Does not prove runtime dispatch unless evidence_class indicates framework/dataflow verification.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| symbol | string | Optional | Symbol | |
| canonical_id | string | Optional | Canonical Id |
get_callers(symbol="verify_password")
CallerListResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| canonical_id | string | Canonical Id |
| callers | array | Callers |
| source | string | Source |
| relationship | string | Relationship |
| evidence_class | string | Evidence Class |
| confidence | string | Confidence |
| file | string | File |
| start_line | integer | Start Line |
Return symbols called or invoked by the specified symbol with evidence_class classification. Primary input: `symbol` (also accepts `canonical_id` as a compatibility alias using the exact same resolution path). Use to inspect downstream dependencies invoked by a function or handler. Does not resolve dynamic callbacks passed as opaque runtime arguments.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| symbol | string | Optional | Symbol | |
| canonical_id | string | Optional | Canonical Id |
get_callees(symbol="process_checkout")
CalleeListResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| canonical_id | string | Canonical Id |
| callees | array | Callees |
| target | string | Target |
| relationship | string | Relationship |
| evidence_class | string | Evidence Class |
| confidence | string | Confidence |
| file | string | File |
| start_line | integer | Start Line |
Compute downstream callers, dependents, affected routes, and related tests if a symbol (`symbol`; `canonical_id` supported as alias) is modified. Use before refactoring or changing a function/class signature. Does not prove runtime failure without inspecting call sites.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| symbol | string | Optional | Symbol | |
| canonical_id | string | Optional | Canonical Id | |
| max_depth | integer | Optional | 3 | Max Depth |
analyze_impact(symbol="DatabasePool.acquire", max_depth=3)
SymbolImpactResult| Field | Type | Description |
|---|---|---|
| symbol | string | Symbol |
| direct_callers | array | Direct Callers |
| transitive_callers | array | Transitive Callers |
| dependent_files | array | Dependent Files |
| affected_routes | array | Affected Routes |
| related_tests | array | Related Tests |
Find functions and methods that call the specified symbol (`symbol`; `canonical_id` supported as alias) up to `max_results`. Use instead of grep or search_code when answering 'who calls X?'. Does not prove runtime execution of conditional branches; preserves POSSIBLE and UNKNOWN evidence classes.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| symbol | string | Optional | Symbol | |
| canonical_id | string | Optional | Canonical Id | |
| max_results | integer | Optional | 20 | Max Results |
find_callers(symbol="place_order", max_results=20)
CallerEdgeList| Field | Type | Description |
|---|---|---|
| source | string | Source |
| target | string | Target |
| relationship | string | Relationship |
| confidence | string | Confidence |
| evidence_class | string | Evidence Class |
| file | string | File |
| start_line | integer | Start Line |
Find functions and methods called by the specified symbol (`symbol`; `canonical_id` supported as alias) up to `max_results`. Use instead of reading multiple files manually when answering 'what does X call?'. Does not resolve opaque runtime callbacks; preserves POSSIBLE and UNKNOWN evidence classes.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| symbol | string | Optional | Symbol | |
| canonical_id | string | Optional | Canonical Id | |
| max_results | integer | Optional | 20 | Max Results |
find_callees(symbol="place_order", max_results=20)
CalleeEdgeList| Field | Type | Description |
|---|---|---|
| source | string | Source |
| target | string | Target |
| relationship | string | Relationship |
| confidence | string | Confidence |
| evidence_class | string | Evidence Class |
| file | string | File |
| start_line | integer | Start Line |
Compute the multi-hop call graph rooted at `symbol` (`canonical_id` supported as alias) up to `depth` and `max_results`. Use when exploring the multi-hop call neighborhood around a central service or controller. Does not prove runtime reachability for specific inputs.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| symbol | string | Optional | Symbol | |
| canonical_id | string | Optional | Canonical Id | |
| depth | integer | Optional | 2 | Depth |
| max_results | integer | Optional | 100 | Max Results |
get_call_graph(symbol="AuthService.authenticate", depth=2, max_results=50)
CallGraphEdgeList| Field | Type | Description |
|---|---|---|
| source | string | Source |
| target | string | Target |
| relationship | string | Relationship |
| confidence | string | Confidence |
| evidence_class | string | Evidence Class |
| depth | integer | Depth |
| file | string | File |
| start_line | integer | Start Line |
Return module-level `IMPORTS` graph edges across the repository or filtered to `file_path`. Use when inspecting raw module-to-module import topology. Does not prove symbol-level call invocation; prefer get_imports or get_dependents for targeted queries.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| file_path | any | Optional | None | File Path |
get_dependency_graph(file_path="src/auth/service.py")
DependencyGraphEdgeList| Field | Type | Description |
|---|---|---|
| source | string | Source |
| target | string | Target |
| relationship | string | Relationship |
| confidence | string | Confidence |
| evidence | string | Evidence |
Return up to `limit` (1..500) parser-confirmed definition and import graph edges with evidence metadata. Use for inspecting raw structural `DEFINES` and `IMPORTS` edges in small repositories or diagnostics. Does not replace targeted relationship tools like get_callers or trace_path.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| limit | integer | Optional | 200 | Limit |
get_graph(limit=50)
GraphEdgeList| Field | Type | Description |
|---|---|---|
| source | string | Source |
| target | string | Target |
| relationship | string | Relationship |
| confidence | string | Confidence |
| evidence_class | string | Evidence Class |
| file | string | File |
| line | integer | Line |
Find functions and methods calling each of the specified symbols in a single round-trip. Use when querying callers of multiple symbols to reduce round trips and multi-turn latency. Does not prove runtime execution of conditional branches.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| symbols | array | Required | - | Symbols |
| max_results_per_symbol | integer | Optional | 10 | Max Results Per Symbol |
batch_find_callers(symbols=["AuthService.login", "TokenValidator.verify"])
dict[str, Any]| Field | Type | Description |
|---|---|---|
| results | string | Results |
| count | integer | Count |
| total_callers | array | Total Callers |
Compute microsecond BFS shortest path between two symbols using the Compressed Sparse Row (CSR) binary graph. Use for instant path tracing between caller and callee. Does not modify graph.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| start_node | string | Required | - | Start Node |
| end_node | string | Required | - | End Node |
fast_graph_path(start_node="handle_checkout", end_node="process_payment")
dict[str, Any]| Field | Type | Description |
|---|---|---|
| start_node | string | Start Node |
| end_node | string | End Node |
| path | string | Path |
| length | string | Length |
Resolve an abstract interface method or trait invocation to all concrete implementing classes in the workspace. Use when tracing dynamic dispatch or trait method implementations. Does not execute code.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| interface_symbol | string | Required | - | Interface Symbol |
| method_name | string | Required | - | Method Name |
resolve_polymorphic_callees(interface_symbol="IOrderRepository", method_name="findById")
dict[str, Any]| Field | Type | Description |
|---|---|---|
| interface_symbol | string | Interface Symbol |
| method_name | string | Method Name |
| total_implementations | string | Total Implementations |
| implementations | string | Implementations |
Inspect third-party dependency manifests (package.json, go.mod, Cargo.toml, requirements.txt) and trace actual internal call site reachability. Use when assessing CVE vulnerability blast radius. Does not execute external dependencies.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| target_package | any | Optional | None | Target Package |
analyze_supply_chain_cve_impact(target_package="lodash")
dict[str, Any]| Field | Type | Description |
|---|---|---|
| workspace | string | Workspace |
| total_dependencies | string | Total Dependencies |
| actively_imported_count | integer | Actively Imported Count |
| packages | string | Packages |
| active_call_sites | string | Active Call Sites |
Core Symbol Inspection & Context Tools (52)
Canonical symbol resolution, bounded context packets, file slices, and evidence verification.
Resolve a symbol name, qualified name, canonical ID, or route into its canonical repository identity and file/line location. Use as the first step before relationship queries when exact symbol identity is unknown or potentially ambiguous. Primary input: `symbol` (also accepts `canonical_id` or `name` as compatibility aliases). Returns canonical_id, ambiguity_state, and candidate alternatives. Does not prove runtime execution or dynamic monkey-patching.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| symbol | string | Optional | Symbol | |
| canonical_id | string | Optional | Canonical Id | |
| name | string | Optional | Name |
resolve_symbol(symbol="AuthService")
SymbolResolutionResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| canonical_id | string | Canonical Id |
| qualified_name | string | Qualified Name |
| file | string | File |
| start_line | integer | Start Line |
| end_line | integer | End Line |
| ambiguity_state | string | Ambiguity State |
| matches | array | Matches |
| alternatives | array | Alternatives |
Search indexed repository symbols by partial name or keyword with ranked relevance. Use when exact symbol spelling is unknown and you need candidate symbol definitions. Returns ranked symbol definitions with file paths and line spans. Does not return module import graphs or call relationships.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| query | string | Required | - | Query |
| top_k | integer | Optional | 20 | Top K |
search_symbols(query="verify_password", top_k=10)
SymbolSearchResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| query | string | Query |
| results | string | Results |
| canonical_id | string | Canonical Id |
| qualified_name | string | Qualified Name |
| kind | string | Kind |
| file | string | File |
| start_line | integer | Start Line |
| end_line | integer | End Line |
Return authoritative signature, kind, parent scope, decorators, and bounded source snippet for a symbol. Primary input: `symbol` (also accepts `canonical_id` or `name` as compatibility aliases). Use when you have a symbol name or canonical_id and need its declaration metadata. Does not traverse multi-hop call graphs.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| symbol | string | Optional | Symbol | |
| canonical_id | string | Optional | Canonical Id | |
| name | string | Optional | Name |
get_symbol(symbol="login_endpoint")
SymbolDetailResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| canonical_id | string | Canonical Id |
| qualified_name | string | Qualified Name |
| kind | string | Kind |
| signature | string | Signature |
| decorators | string | Decorators |
| file | string | File |
| start_line | integer | Start Line |
| end_line | integer | End Line |
| snippet | string | Snippet |
Open and inspect a repository file's structural AST outline or a bounded line range (`path`, `start_line`, `end_line`, `max_lines`). Use after `search_code`, `find_symbol`, or `find_routes` identifies a target file and line span across Python, HTML, Jinja, JS, TS, CSS, YAML, JSON, or Markdown. Blocks path traversal, binary files, and sensitive files; does not prove cross-file callers.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| path | string | Required | - | Path |
| start_line | any | Optional | None | Start Line |
| end_line | any | Optional | None | End Line |
| max_lines | integer | Optional | 200 | Max Lines |
| include_content | boolean | Optional | False | Include Content |
get_file(path="templates/dashboard.html", start_line=40, end_line=110)
FileStructureResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| path | string | Path |
| file | string | File |
| start_line | integer | Start Line |
| end_line | integer | End Line |
| content | string | Content |
| truncated | boolean | Truncated |
| category | string | Category |
| file_category | string | File Category |
| artifact_type | string | Artifact Type |
| symbols | array | Symbols |
| imports | string | Imports |
| freshness | boolean | Freshness |
Return verified and candidate references to a symbol across the repository with evidence_class labels. Primary input: `symbol` (also accepts `canonical_id` or `name` as compatibility aliases). Use for cross-file reference, registration, dispatch, or DI binding lookup. Does not guarantee dynamic reflection targets when evidence_class is UNKNOWN or POSSIBLE.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| symbol | string | Optional | Symbol | |
| canonical_id | string | Optional | Canonical Id | |
| name | string | Optional | Name |
get_references(symbol="command_registry")
ReferenceListResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| canonical_id | string | Canonical Id |
| references | string | References |
| relationship | string | Relationship |
| evidence_class | string | Evidence Class |
| confidence | string | Confidence |
| file | string | File |
| start_line | integer | Start Line |
Return parser-extracted module and symbol imports for a file or symbol (`file` or `symbol`; `canonical_id` and `path` supported as aliases). Use for forward dependency and package boundary questions. Does not return reverse importers (use get_dependents for reverse dependencies).
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| symbol | any | Optional | None | Symbol |
| file | any | Optional | None | File |
| canonical_id | any | Optional | None | Canonical Id |
| path | any | Optional | None | Path |
get_imports(file="src/auth/routes.py")
ImportsResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| file | string | File |
| imports | string | Imports |
| source | string | Source |
| target | string | Target |
| relationship | string | Relationship |
| evidence_class | string | Evidence Class |
Return files, symbols, and packages that import or depend on the target symbol or file (`symbol` or `file`; `canonical_id` and `path` supported as aliases). Use for blast-radius, change-impact, and package boundary analysis. Does not prove runtime failure without checking test and caller evidence.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| symbol | any | Optional | None | Symbol |
| file | any | Optional | None | File |
| canonical_id | any | Optional | None | Canonical Id |
| path | any | Optional | None | Path |
get_dependents(file="src/auth/repository.py")
DependentsResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| dependents | string | Dependents |
| source | string | Source |
| target | string | Target |
| relationship | string | Relationship |
| evidence_class | string | Evidence Class |
| file | string | File |
Return structural repository overview including modules, workspace packages (`DEPENDS_ON_PACKAGE`), entrypoints, and layer relationships. Use for high-level architecture, monorepo package boundary, and onboarding questions. Does not replace symbol-level evidence for specific bug fixes.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| No arguments required. | ||||
get_architecture()
ArchitectureOverviewResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| modules | string | Modules |
| packages | string | Packages |
| package_dependencies | string | Package Dependencies |
| entrypoints | string | Entrypoints |
| routes | array | Routes |
| summary | string | Summary |
Compile a token-bounded, coverage-optimized ContextPacket containing verified symbols, compressed relationships, routes, DI providers, packages, and related tests. Primary input: `query` (natural-language question, symbol, or task description; `task` is also supported as a compatibility alias for string or structured TaskSpec dict). Budget controls: `max_tokens` (default 4000, hard cap 20000), `max_files` (default 25, hard cap 40), `max_lines` (default 500, hard cap 1500). Preserves UNKNOWN, POSSIBLE, and AMBIGUOUS states explicitly. Does not return full raw files; use targeted get_file or read_file only if exact omitted lines are needed afterward.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| query | string | Optional | Query | |
| task | any | Optional | Task | |
| intent | any | Optional | None | Intent |
| max_tokens | integer | Optional | 4000 | Max Tokens |
| max_files | integer | Optional | 25 | Max Files |
| max_lines | integer | Optional | 500 | Max Lines |
| top_k | integer | Optional | 25 | Top K |
| plan | any | Optional | None | Plan |
| mode | string | Optional | BALANCED | Mode |
| explain | boolean | Optional | False | Explain |
| resource_mode | any | Optional | None | Resource Mode |
get_context(query="How does UserRepository get injected into UserController", intent="DEBUG", max_tokens=4000)
ContextPacket| Field | Type | Description |
|---|---|---|
| symbols | array | Symbols |
| relationships | string | Relationships |
| routes | array | Routes |
| tests | array | Tests |
| packages | string | Packages |
| unknowns | string | Unknowns |
| conflicts | string | Conflicts |
| uncertainties | string | Uncertainties |
| freshness | boolean | Freshness |
| selected_tokens | integer | Selected Tokens |
| candidate_tokens | integer | Candidate Tokens |
| selected_files | array | Selected Files |
| selected_lines | integer | Selected Lines |
| coverage_score | string | Coverage Score |
| truncated | boolean | Truncated |
| candidate_token_estimate | string | Candidate Token Estimate |
| selected_token_estimate | string | Selected Token Estimate |
| context_reduction_pct | string | Context Reduction Pct |
| coverage | string | Coverage |
Read a bounded line range (1..500 lines) of a non-sensitive repository file. Use AFTER CodeGraph tools identify the exact file and line span, or directly for trivial single-file edits. Blocks path traversal and sensitive credential files. Does not compute cross-file relationships.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| path | string | Required | - | Path |
| start_line | integer | Optional | 1 | Start Line |
| end_line | integer | Optional | 200 | End Line |
read_file(path="src/auth/service.py", start_line=10, end_line=45)
FileContentSlice| Field | Type | Description |
|---|---|---|
| file | string | File |
| start_line | integer | Start Line |
| end_line | integer | End Line |
| content | string | Content |
Search literal text, HTML/Jinja template IDs, UI strings, CSS selectors, config keys, or route paths across readable repository files and indexed code chunks. Use instead of grep when searching for exact text, button labels, or template strings. Does not prove semantic call, import, or route relationships; never creates semantic graph edges from text matches.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| query | string | Required | - | Query |
| top_k | integer | Optional | 10 | Top K |
| path_filter | any | Optional | None | Path Filter |
| file_types | any | Optional | None | File Types |
| include_tests | boolean | Optional | True | Include Tests |
| include_configs | boolean | Optional | True | Include Configs |
| max_results | integer | Optional | 20 | Max Results |
search_code(query="Add Manual Entry", top_k=10)
CodeChunkSearchResult| Field | Type | Description |
|---|---|---|
| path | string | Path |
| file | string | File |
| line | integer | Line |
| start_line | integer | Start Line |
| end_line | integer | End Line |
| matched_text | string | Matched Text |
| snippet | string | Snippet |
| category | string | Category |
| file_category | string | File Category |
| match_type | string | Match Type |
| symbol | string | Symbol |
| score | string | Score |
| reason | string | Reason |
Find function, method, or class definitions by exact short name or qualified name (`symbol`; `name` and `canonical_id` supported as aliases). Use instead of grep when locating where a class, function, or method is defined. Does not return callers, callees, or ambiguity alternatives like resolve_symbol.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| symbol | string | Optional | Symbol | |
| name | string | Optional | Name | |
| canonical_id | string | Optional | Canonical Id |
find_symbol(symbol="InventoryService")
SymbolLocationList| Field | Type | Description |
|---|---|---|
| symbol | string | Symbol |
| kind | string | Kind |
| file | string | File |
| start_line | integer | Start Line |
| end_line | integer | End Line |
Find textual occurrences and references of a symbol name (`symbol`; `name` and `canonical_id` supported as aliases) across indexed code chunks. Use when locating references or mentions of an identifier across files. Does not prove semantic call edges; use get_references when full relationship classification is required.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| symbol | string | Optional | Symbol | |
| name | string | Optional | Name | |
| canonical_id | string | Optional | Canonical Id |
find_references(symbol="parse_bill")
ChunkReferenceList| Field | Type | Description |
|---|---|---|
| file | string | File |
| symbol | string | Symbol |
| start_line | integer | Start Line |
| end_line | integer | End Line |
Normalize a developer question or task (`query`; `task` supported as string or TaskSpec dict alias) into a structured `TaskSpec`, ground targets against the index, detect ambiguities, and build a `RetrievalPlan`. Use before get_context when you want to inspect target resolution and ambiguity candidates prior to context retrieval. Does not retrieve source code snippets.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| query | string | Optional | Query | |
| task | any | Optional | Task | |
| max_tokens | integer | Optional | 20000 | Max Tokens |
| resource_mode | string | Optional | BALANCED | Resource Mode |
compile_task(query="Debug AuthService")
CompiledTaskPlan| Field | Type | Description |
|---|---|---|
| task_spec | string | Task Spec |
| ambiguity | string | Ambiguity |
| ambiguities | string | Ambiguities |
| entry_points | string | Entry Points |
| retrieval_plan | string | Retrieval Plan |
| recommended_next_step | string | Recommended Next Step |
Construct a deterministic `RetrievalPlan` for a question or task (`query`; `task` supported as alias) without executing graph or source retrieval. Use to inspect planned retrieval steps, token budgets, and query expansions. Does not return code snippets or relationship edges.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| query | string | Optional | Query | |
| task | any | Optional | Task | |
| max_tokens | integer | Optional | 20000 | Max Tokens |
| resource_mode | string | Optional | BALANCED | Resource Mode |
plan_retrieval(query="Trace payment processing")
RetrievalPlanDict| Field | Type | Description |
|---|---|---|
| intent | string | Intent |
| steps | string | Steps |
| token_budget | string | Token Budget |
| expanded_queries | array | Expanded Queries |
| ambiguities | string | Ambiguities |
Return repository indexing status, generation counter, freshness state (`FRESH` or `STALE`), symbol counts, and modified/deleted file lists. Use to check whether the index is fresh before trusting cached graph facts after disk edits. Does not re-index the repository automatically.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| No arguments required. | ||||
get_repository_status()
RepositoryStatusReport| Field | Type | Description |
|---|---|---|
| repository | string | Repository |
| generation | string | Generation |
| freshness | boolean | Freshness |
| freshness_detail | boolean | Freshness Detail |
| files_indexed | array | Files Indexed |
| symbols_indexed | array | Symbols Indexed |
| graph_edges | array | Graph Edges |
| framework_routes | array | Framework Routes |
| modified_files | array | Modified Files |
| deleted_files | array | Deleted Files |
| parse_failed_files | array | Parse Failed Files |
Return up to 500 indexed repository-relative source file paths in deterministic sorted order. Use for a flat inventory of indexed files when exploring a small project. Does not return package dependency graphs or entrypoints (prefer get_architecture).
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| No arguments required. | ||||
get_project_structure()
IndexedFilePathList| Field | Type | Description |
|---|---|---|
| path | string | Path |
List up to 500 raw parser-extracted `(source_path, imported)` rows from the imports table. Use for bulk inspection of raw import statements across the repository. Does not resolve workspace package boundaries; prefer get_imports or get_architecture.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| No arguments required. | ||||
get_dependencies()
RawImportRowList| Field | Type | Description |
|---|---|---|
| source_path | string | Source Path |
| imported | string | Imported |
List extracted symbols (`symbol`, `kind`, `start_line`, `end_line`) in a single repository-relative file. Use for a lightweight symbol table of one file when imports and artifact metadata are not needed. Does not return cross-file relationships; prefer get_file for full file outline.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| path | string | Required | - | Path |
get_file_symbols(path="src/auth/service.py")
FileSymbolRowList| Field | Type | Description |
|---|---|---|
| symbol | string | Symbol |
| kind | string | Kind |
| start_line | integer | Start Line |
| end_line | integer | End Line |
Search local SQLite repository memory notes by keyword up to `limit` (1..100). Use only to recall previously stored local session notes. Never overrides current AST or source-file evidence; does not prove current repository state.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| query | string | Required | - | Query |
| limit | integer | Optional | 20 | Limit |
search_memory(query="auth", limit=10)
MemoryNoteList| Field | Type | Description |
|---|---|---|
| key | string | Key |
| value | string | Value |
Return bounded source-derived `Evidence` citations (`file`, `start_line`, `end_line`, `symbol`, `snippet`, `content_hash`) for a non-sensitive file or symbol. Use when constructing hash-verifiable code citations. Blocks sensitive files and does not compute cross-file callers.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| path | string | Required | - | Path |
| symbol | any | Optional | None | Symbol |
get_evidence(path="src/auth/service.py", symbol="AuthService.authenticate")
EvidenceCitationList| Field | Type | Description |
|---|---|---|
| file | string | File |
| start_line | integer | Start Line |
| end_line | integer | End Line |
| symbol | string | Symbol |
| snippet | string | Snippet |
| content_hash | string | Content Hash |
Verify that a cited evidence span (`file_path`, `start_line`, `end_line`) exists on disk, matches `expected_hash`, and is not stale. Use to validate whether previously retrieved evidence is still current after repository edits. Does not re-index modified files.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| file_path | string | Required | - | File Path |
| start_line | integer | Required | - | Start Line |
| end_line | integer | Required | - | End Line |
| expected_hash | any | Optional | None | Expected Hash |
| symbol | any | Optional | None | Symbol |
verify_evidence(file_path="src/auth/service.py", start_line=1, end_line=20)
EvidenceVerificationResult| Field | Type | Description |
|---|---|---|
| valid | string | Valid |
| file | string | File |
| start_line | integer | Start Line |
| end_line | integer | End Line |
| reason | string | Reason |
| current_hash | string | Current Hash |
Return current resource governor state including memory usage, pressure level, concurrency limits, and activity mode. Use for diagnosing server resource pressure or throttling behavior. Does not inspect repository source code or symbols.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| No arguments required. | ||||
get_resource_status()
ResourceGovernorState| Field | Type | Description |
|---|---|---|
| mode | string | Mode |
| pressure | string | Pressure |
| rss_mb | string | Rss Mb |
| active_tasks | string | Active Tasks |
Detect semantic and contract conflicts between Git branches (calling deleted symbols, broken call signatures, or missing route handlers). Use when verifying whether branches can be safely merged without semantic breakage. Does not report false conflicts when branches are structurally compatible.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| base_branch | string | Optional | main | Base Branch |
| head_branch | string | Optional | HEAD | Head Branch |
detect_semantic_conflicts(base_branch="main", head_branch="HEAD")
SemanticConflictResult| Field | Type | Description |
|---|---|---|
| base_branch | string | Base Branch |
| head_branch | string | Head Branch |
| has_conflicts | string | Has Conflicts |
| total_conflicts | string | Total Conflicts |
| conflicts | string | Conflicts |
| summary | string | Summary |
Perform a deterministic, syntax-validated, transaction-safe AST rename of a symbol across the repository. Use when renaming a function, method, or class across multiple files safely with in-memory preview diffs. Does not prove runtime equivalence beyond AST syntax validation and statically verified references.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| target | string | Required | - | Target |
| new_name | string | Required | - | New Name |
| dry_run | boolean | Optional | True | Dry Run |
| force_uncertain | boolean | Optional | False | Force Uncertain |
safe_rename(target="AuthService", new_name="AuthenticationService", dry_run=True)
RefactorResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| target_symbol | string | Target Symbol |
| new_name | string | New Name |
| risk | string | Risk |
| files_changed | array | Files Changed |
| spans_count | integer | Spans Count |
| diffs | string | Diffs |
| rollback_id | string | Rollback Id |
| errors | string | Errors |
Atomically rollback an applied refactoring transaction using its rollback manifest ID. Use when reverting an applied refactoring transaction to restore original source files cleanly. Does not restore files if they were modified externally after refactoring was applied.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| transaction_id | string | Required | - | Transaction Id |
rollback_refactor(transaction_id="rf_12345")
RefactorResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| target_symbol | string | Target Symbol |
| new_name | string | New Name |
| files_changed | array | Files Changed |
| rollback_id | string | Rollback Id |
| errors | string | Errors |
Detect and attribute active localhost services, ports, PIDs, frameworks, and workspace sub-packages with zero idle CPU. Use when diagnosing running dev servers or multi-service architectures. Does not prove live HTTP response payloads or application layer health.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| No arguments required. | ||||
get_live_services()
dict[str, Any]| Field | Type | Description |
|---|---|---|
| live_services | string | Live Services |
| configured_services | string | Configured Services |
| count | integer | Count |
Detect database schema drift between migration files, live database state, and code ORM models with zero idle CPU. Flags unmapped tables, missing columns, and migration version state. Use when verifying whether database migrations are up to date with code models. Does not execute SQL data assertions or validate column constraints against live row data.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| No arguments required. | ||||
check_db_drift()
dict[str, Any]| Field | Type | Description |
|---|---|---|
| status | string | Status |
| unmapped_tables | array | Unmapped Tables |
| missing_columns | array | Missing Columns |
| migration_version | string | Migration Version |
| is_drifted | string | Is Drifted |
Stitch and reconstruct multi-service distributed execution trees across frontend, backend, and database boundaries for a specific W3C trace ID. Use when tracing cross-service requests or debugging multi-service latency bottlenecks. Does not capture unobserved code paths or untraced sidecar requests.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| trace_id | string | Required | - | Trace Id |
get_distributed_trace(trace_id="4bf92f3577b34da6a3ce929d0e0e4736")
dict[str, Any]| Field | Type | Description |
|---|---|---|
| trace_id | string | Trace Id |
| status | string | Status |
| root_span | string | Root Span |
| total_spans | string | Total Spans |
| services_involved | string | Services Involved |
| timeline | integer | Timeline |
Detect client-server API contract drift between frontend fetch or axios calls and backend route registrations. Flags orphaned client endpoints (404s) and HTTP method mismatches (405s). Use when validating frontend API calls against backend endpoints before deployment. Does not execute live HTTP requests or validate dynamic URL strings constructed via runtime interpolation.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| No arguments required. | ||||
check_api_drift()
dict[str, Any]| Field | Type | Description |
|---|---|---|
| status | string | Status |
| orphaned_client_routes | array | Orphaned Client Routes |
| method_mismatches | array | Method Mismatches |
| verified_contracts_count | integer | Verified Contracts Count |
Catalog monorepo workspace packages, tools (pnpm, Turborepo, npm/yarn workspaces), entry points, and inter-package dependencies. Use when mapping multi-package repository structure and package boundaries. Does not prove build system execution order or runtime dependency loading.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| No arguments required. | ||||
get_monorepo_packages()
dict[str, Any]| Field | Type | Description |
|---|---|---|
| tool | string | Tool |
| packages | string | Packages |
| dependency_graph | string | Dependency Graph |
| root_path | string | Root Path |
Retrieve authoritative signature, kind, parent scope, decorators, and bounded source snippet for multiple symbols in a single round-trip. Use when inspecting multiple related symbols to minimize turn count and token overhead. Does not traverse multi-hop call graphs.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| symbols | array | Required | - | Symbols |
batch_get_symbols(symbols=["UserService", "OrderService"])
dict[str, Any]| Field | Type | Description |
|---|---|---|
| results | string | Results |
| count | integer | Count |
| found_count | integer | Found Count |
Compile token-bounded, coverage-optimized ContextPackets for multiple task prompts or symbol targets in a single call. Use when retrieving separate focused contexts for different sub-tasks concurrently. Does not execute repository code or tests.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| tasks | any | Required | - | Tasks |
| max_tokens_per_task | integer | Optional | 2000 | Max Tokens Per Task |
batch_get_context(tasks=[{"query": "auth service", "intent": "DEBUG"}, {"query": "payment processor", "intent": "TRACE"}])
dict[str, Any]| Field | Type | Description |
|---|---|---|
| results | string | Results |
| count | integer | Count |
Dry-run preview a multi-file semantic patch across repository files with pre-flight syntax validation and unified diffs. Use when verifying multi-file changes, syntax correctness, and diff previews before applying modifications to disk. Guarantees zero disk mutation during preview. Does not commit modifications to disk.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| patches | array | Required | - | Patches |
preview_semantic_patch(patches=[{"path": "app.py", "hunks": [{"target": "old()", "replacement": "new()"}]}])
RefactorResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| files_changed | array | Files Changed |
| diffs | string | Diffs |
| errors | string | Errors |
Atomically apply a multi-file semantic patch across repository files with pre-flight syntax validation and rollback support. Use when executing validated multi-file code modifications with transactional safety and rollback guarantees. Does not prove semantic preservation beyond syntax validation and hash preconditions.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| patches | array | Required | - | Patches |
| dry_run | boolean | Optional | False | Dry Run |
apply_semantic_patch(patches=[{"path": "app.py", "hunks": [{"target": "a", "replacement": "b"}]}])
RefactorResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| files_changed | array | Files Changed |
| rollback_id | string | Rollback Id |
| diffs | string | Diffs |
| errors | string | Errors |
Detect zero-caller functions, classes, uncalled zombie HTTP routes, and orphaned database tables by cross-referencing AST graphs with runtime traces. Use when identifying unused code, zombie endpoints, or unread/unwritten database tables. Does not prove unobserved paths are impossible when runtime traces are absent.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| max_symbols | integer | Optional | 50 | Max Symbols |
find_dead_code()
dict[str, Any]| Field | Type | Description |
|---|---|---|
| repository | string | Repository |
| dead_symbols | array | Dead Symbols |
| zombie_routes | array | Zombie Routes |
| orphaned_tables | array | Orphaned Tables |
| runtime_traces_present | string | Runtime Traces Present |
| total_dead_count | integer | Total Dead Count |
Generate comprehensive semantic PR review evaluating structural diffs, caller contract breaks, affected routes, and test gaps. Use when reviewing pull requests or evaluating branch changes before merging. Does not execute repository code or guarantee merge builds pass without running tests.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| base_ref | string | Optional | main | Base Ref |
| head_ref | string | Optional | HEAD | Head Ref |
generate_pr_review(base_ref="main", head_ref="HEAD")
dict[str, Any]| Field | Type | Description |
|---|---|---|
| base_ref | string | Base Ref |
| head_ref | string | Head Ref |
| verdict | string | Verdict |
| summary | string | Summary |
| findings | string | Findings |
| files_changed | array | Files Changed |
| affected_routes | array | Affected Routes |
| affected_tests | array | Affected Tests |
| suggested_test_command | string | Suggested Test Command |
| markdown_report | string | Markdown Report |
Discover and catalog federated repositories in a multi-repo workspace. Use when mapping microservice boundaries and cross-service index sizes. Does not modify child repository indices or re-index dirty working trees automatically.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| workspace_root | any | Optional | None | Workspace Root |
federate_repositories()
dict[str, Any]| Field | Type | Description |
|---|---|---|
| workspace_root | string | Workspace Root |
| repos | string | Repos |
| total_repos | string | Total Repos |
| total_links | string | Total Links |
Store an agent debugging trajectory, test repair pattern, or architectural decision into persistent memory. Use when recording successful bug resolutions or architecture decisions for future recall. Does not share stored memory outside the local repository index.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| title | string | Required | - | Title |
| resolution | string | Required | - | Resolution |
| category | string | Optional | BUG_FIX | Category |
| symptoms | string | Optional | Symptoms | |
| root_cause | string | Optional | Root Cause |
store_agent_memory(title="Fixed token leak", resolution="Closed session in finally block")
dict[str, Any]| Field | Type | Description |
|---|---|---|
| id | string | Id |
| created_at | string | Created At |
| session_id | string | Session Id |
| category | string | Category |
| title | string | Title |
| symptoms | string | Symptoms |
| root_cause | string | Root Cause |
| resolution | string | Resolution |
| files | array | Files |
| tags | string | Tags |
| outcome | string | Outcome |
| score | string | Score |
Search past agent debugging memories and architectural decisions using FTS5 BM25 ranking. Use when investigating recurring bugs or checking past resolutions. Does not guarantee past solutions apply to unrelated bugs without semantic match.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| query | string | Required | - | Query |
| category | any | Optional | None | Category |
| limit | integer | Optional | 5 | Limit |
| max_tokens | integer | Optional | 1500 | Max Tokens |
query_agent_memory(query="401 token expiry")
dict[str, Any]| Field | Type | Description |
|---|---|---|
| query | string | Query |
| count | integer | Count |
| memories | string | Memories |
Analyze source-to-sink dataflow taint paths for injection and security vulnerabilities (SQL injection CWE-89, command execution CWE-78, path traversal CWE-22, SSRF CWE-918, insecure deserialization CWE-502) using AST dataflow tracking. Use when auditing endpoint security, sanitization gaps, or vulnerable data sinks. Does not execute repository code; reports AST-verified taint propagation chains.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| entrypoint_symbol | any | Optional | None | Entrypoint Symbol |
| filter_cwe | any | Optional | None | Filter Cwe |
| max_depth | integer | Optional | 12 | Max Depth |
analyze_dataflow_taint(filter_cwe="CWE-89")
dict[str, Any]| Field | Type | Description |
|---|---|---|
| repository | string | Repository |
| total_vulnerabilities | string | Total Vulnerabilities |
| critical_count | integer | Critical Count |
| high_count | integer | High Count |
| vulnerabilities | string | Vulnerabilities |
Perform automated self-healing, SQLite integrity verification, rebuilding corrupted FTS5 indices, pruning dangling FK references, clearing stale locks, and truncating WAL logs. Use when the repository index encounters lock contention, corrupted FTS entries, or orphaned edges. Does not delete source repository code.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| deep | boolean | Optional | True | Deep |
| vacuum | boolean | Optional | False | Vacuum |
repair_repository_index(deep=True, vacuum=True)
dict[str, Any]| Field | Type | Description |
|---|---|---|
| status | string | Status |
| integrity_check_passed | string | Integrity Check Passed |
| fts_rebuilt | string | Fts Rebuilt |
| wal_checkpointed | string | Wal Checkpointed |
| stale_locks_cleared | string | Stale Locks Cleared |
Collect live compiler diagnostics, type errors, and lint warnings via Language Server Protocol (LSP) daemons (pyright, gopls, rust-analyzer, clangd). Use when diagnosing compile errors, missing types, or verifying code correctness across languages. Does not modify source files; reports language-server diagnostics.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| file_path | any | Optional | None | File Path |
get_lsp_diagnostics(file_path="src/service.py")
dict[str, Any]| Field | Type | Description |
|---|---|---|
| workspace | string | Workspace |
| status | string | Status |
| total_diagnostics | string | Total Diagnostics |
| error_count | integer | Error Count |
| warning_count | integer | Warning Count |
| diagnostics | string | Diagnostics |
Register an active AI coding agent session in the multi-agent shared workspace. Use when joining a swarm or announcing an active coding task to coordinate with other agents. Does not acquire file locks.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| agent_id | string | Required | - | Agent Id |
| name | string | Required | - | Name |
| task | string | Required | - | Task |
register_agent_session(agent_id="claude-1", name="RefactorBot", task="Refactor auth")
dict[str, Any]| Field | Type | Description |
|---|---|---|
| agent_id | string | Agent Id |
| name | string | Name |
| task_description | string | Task Description |
| registered_at | string | Registered At |
| status | string | Status |
Claim a lease lock on a file path to prevent concurrent edit clobbering by other AI agents. Use before modifying a file in a multi-agent environment. Does not modify file content.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| agent_id | string | Required | - | Agent Id |
| file_path | string | Required | - | File Path |
| lease_type | string | Optional | EXCLUSIVE_WRITE | Lease Type |
| ttl_seconds | number | Optional | 60.0 | Ttl Seconds |
claim_file_lease(agent_id="agent-1", file_path="src/auth.py")
dict[str, Any]| Field | Type | Description |
|---|---|---|
| success | boolean | Success |
| message | string | Message |
| file_path | string | File Path |
| agent_id | string | Agent Id |
| lease_type | string | Lease Type |
Release one or all file leases held by an AI agent upon completing task edits. Use after committing or discarding file edits. Does not delete source files.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| agent_id | string | Required | - | Agent Id |
| file_path | any | Optional | None | File Path |
release_file_lease(agent_id="agent-1")
dict[str, Any]| Field | Type | Description |
|---|---|---|
| released_count | integer | Released Count |
| agent_id | string | Agent Id |
| file_path | string | File Path |
Return consolidated multi-agent status report including active agent sessions, held file leases, and predicted AST conflicts. Use to check if other agents are working on related files. Does not acquire locks.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| No arguments required. | ||||
get_multi_agent_status()
dict[str, Any]| Field | Type | Description |
|---|---|---|
| workspace | string | Workspace |
| total_agents | string | Total Agents |
| active_leases_count | integer | Active Leases Count |
| conflicts_count | integer | Conflicts Count |
| agents | string | Agents |
| leases | string | Leases |
| conflicts | string | Conflicts |
Project an in-memory virtual AST branch in RAM to evaluate caller breakages, parameter mismatches, and route mutations without modifying disk files. Use before writing refactoring patches. Does not modify disk files.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| patches | object | Required | - | Patches |
evaluate_speculative_patch(patches={"src/auth.py": "def login(user): return True"})
dict[str, Any]| Field | Type | Description |
|---|---|---|
| is_safe | string | Is Safe |
| modified_files | array | Modified Files |
| contract_breaks | string | Contract Breaks |
| route_mutations | string | Route Mutations |
| diff_summary | string | Diff Summary |
Evaluate declarative architectural boundaries, forbidden cross-module dependencies, and layer rules against the repository index. Use when checking pull request compliance with enterprise architecture. Does not modify code.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| rules | any | Optional | None | Rules |
verify_architectural_rules()
dict[str, Any]| Field | Type | Description |
|---|---|---|
| status | string | Status |
| total_rules_checked | string | Total Rules Checked |
| violations_count | integer | Violations Count |
| violations | string | Violations |
Perform DI-aware root-to-leaf reachability analysis from HTTP routes, CLIs, and crons to detect true dead code with STATIC_VERIFIED confidence. Use when pruning dead code or unused legacy modules. Does not delete code.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| No arguments required. | ||||
find_unreachable_code()
dict[str, Any]| Field | Type | Description |
|---|---|---|
| workspace | string | Workspace |
| total_symbols | array | Total Symbols |
| reachable_count | integer | Reachable Count |
| unreachable_count | integer | Unreachable Count |
| dead_code_percentage | string | Dead Code Percentage |
Synthesize human-readable release changelog categorizing breaking changes, new endpoints, and database mutations from AST diffs. Use when writing release notes or preparing deployment summaries. Does not modify git repository.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| base_ref | string | Optional | HEAD~1 | Base Ref |
| head_ref | string | Optional | HEAD | Head Ref |
generate_semantic_changelog(base_ref="HEAD~5", head_ref="HEAD")
dict[str, Any]| Field | Type | Description |
|---|---|---|
| base_ref | string | Base Ref |
| head_ref | string | Head Ref |
| total_changes | string | Total Changes |
| breaking_changes_count | integer | Breaking Changes Count |
| markdown_changelog | string | Markdown Changelog |
Trace inter-procedural dataflow, return type inference, and unguarded None/null dereferences across caller-callee boundaries. Use when investigating NullPointerExceptions or type contract violations. Does not execute code.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| target_symbol | string | Required | - | Target Symbol |
propagate_interprocedural_dataflow(target_symbol="find_user")
dict[str, Any]| Field | Type | Description |
|---|---|---|
| target_symbol | string | Target Symbol |
| inferred_return_type | string | Inferred Return Type |
| is_nullable | string | Is Nullable |
| nullability_warnings | string | Nullability Warnings |
Framework Route Discovery Tools (4)
Framework-aware HTTP route mapping for FastAPI, Flask, Django, and Express.
Return HTTP/RPC framework routes, mounted router prefixes (`MOUNTS`), methods, and handler symbols. Use when locating API endpoints, route handlers, or mounted sub-applications (FastAPI, Flask, Django, Express, NestJS). Does not prove runtime middleware authentication unless traced via get_context or trace_path.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| framework | any | Optional | None | Framework |
| method | any | Optional | None | Method |
| path | any | Optional | None | Path |
list_routes(method="POST", path="/api/v1/auth/login")
RouteListResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| routes | array | Routes |
| route_path | string | Route Path |
| http_method | string | Http Method |
| handler_name | string | Handler Name |
| canonical_id | string | Canonical Id |
| framework | string | Framework |
| file | string | File |
| line | integer | Line |
| evidence_class | string | Evidence Class |
Find HTTP/RPC framework routes, mounted router prefixes (`MOUNTS`), methods, and handler symbols across FastAPI, Flask, Django, Express, and NestJS. Use instead of grep when locating API endpoints or route handlers. Does not prove runtime middleware authentication unless traced via trace_path or get_context.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| framework | any | Optional | None | Framework |
| method | any | Optional | None | Method |
| path | any | Optional | None | Path |
find_routes(path="/api/scan-bill")
RouteListResult| Field | Type | Description |
|---|---|---|
| status | string | Status |
| routes | array | Routes |
| route_path | string | Route Path |
| http_method | string | Http Method |
| handler_name | string | Handler Name |
| canonical_id | string | Canonical Id |
| framework | string | Framework |
| file | string | File |
| line | integer | Line |
| evidence_class | string | Evidence Class |
Use when detecting schema validation drift between a route/handler input schema (Pydantic BaseModel, Django Form, DRF Serializer) and destination database table columns. Flags MISSING_REQUIRED_COLUMN, NULLABILITY_MISMATCH, TYPE_INCOMPATIBILITY, LENGTH_CONSTRAINT_DRIFT, and UNUSED_SCHEMA_FIELD. Does not execute live requests.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| route | string | Optional | Route | |
| handler | string | Optional | Handler | |
| table | any | Optional | None | Table |
| schema | any | Optional | None | Schema |
check_route_schema_drift(route="/api/v1/orders/checkout")
dict[str, Any]| Field | Type | Description |
|---|---|---|
| status | string | Status |
| route_or_handler | string | Route Or Handler |
| target_table | string | Target Table |
| schema_name | string | Schema Name |
| drift_count | integer | Drift Count |
| critical_count | integer | Critical Count |
| warning_count | integer | Warning Count |
| info_count | integer | Info Count |
| issues | string | Issues |
Resolve cross-repository HTTP and RPC service-to-service links across microservices. Use when tracing requests across separate repositories. Does not prove unobserved dynamic endpoints without static route or URL evidence.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| workspace_root | any | Optional | None | Workspace Root |
| query | any | Optional | None | Query |
find_cross_repo_routes(query="/api/v1/users")
dict[str, Any]| Field | Type | Description |
|---|---|---|
| workspace_root | string | Workspace Root |
| total_links | string | Total Links |
| cross_repo_links | string | Cross Repo Links |
Test Discovery & Coverage Tools (3)
Deterministic symbol-to-test suite mapping.
Find test files and test functions statically linked to a target symbol (`symbol`; `canonical_id` supported as alias) via direct calls, imports, fixtures, or route invocation. Use instead of grep when answering 'what tests cover symbol X?'. Does not execute tests at runtime and never fabricates coverage from lexical similarity alone.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| symbol | string | Optional | Symbol | |
| canonical_id | string | Optional | Canonical Id | |
| max_results | integer | Optional | 10 | Max Results |
find_tests(symbol="parse_bill")
RelatedTestsResult| Field | Type | Description |
|---|---|---|
| test_symbol | string | Test Symbol |
| file | string | File |
| start_line | integer | Start Line |
| end_line | integer | End Line |
| relationship | string | Relationship |
| evidence_class | string | Evidence Class |
| confidence | string | Confidence |
| reason | string | Reason |
Generate production-ready test scaffolding with fixtures, dependency mocks (DB sessions, HTTP clients), and boundary test cases for a symbol or route. Use when writing tests for untested functions or HTTP endpoints. Does not execute generated tests or prove test assertions pass without execution.
| Parameter | Type | Status | Default | Description |
|---|---|---|---|---|
| target | string | Required | - | Target |
| framework | any | Optional | None | Framework |
generate_test_scaffolding(target="process_payment")
dict[str, Any]| Field | Type | Description |
|---|---|---|
| target_symbol | string | Target Symbol |
| target_file | string | Target File |
| framework | string | Framework |
| suggested_test_file | string | Suggested Test File |
| test_code | string | Test Code |
| mock_requirements | string | Mock Requirements |
| test_cases | string | Test Cases |
CLI Commands Reference (13 Commands)
CodeGraph MCP provides 13 deterministic terminal commands for repository indexing, health auditing, MCP server hosting, and context extraction.
Initialize repository indexing and configuration.
codegraph init .
| Flag | Description |
|---|---|
| --repository, -r <path> | Repository path |
| --json | Machine-readable JSON output |
Initialized CodeGraph repository at /path/to/repo (indexed 190 files)
Perform incremental AST & relationship indexing with 16-phase telemetry.
codegraph index . --verbose
| Flag | Description |
|---|---|
| --verbose, -v | Show phase-by-phase timings and memory usage |
| --quiet, -q | Suppress progress blocks |
| --json | Output phase metrics as JSON |
Phase: Repository Scan [190/190 files, 100%] elapsed: 0.09s Phase: Final Commit & Checkpoint scanned=190 indexed=1 unchanged=189 removed=0
Inspect index freshness, file counts, and resource consumption in < 5ms.
codegraph status .
| Flag | Description |
|---|---|
| --repository, -r <path> | Repository path |
{
"status": "FRESH",
"files": 190,
"symbols": 1944,
"graph_edges": 14293,
"resource_profile": "BALANCED"
}
Verify SQLite schema integrity, foreign keys, FTS search, and orphaned processes.
codegraph doctor --database
| Flag | Description |
|---|---|
| --database | Run deep schema & foreign key checks |
| --processes | Audit active MCP processes and parent PIDs |
| --json | Output diagnostic report as JSON |
{
"status": "OK",
"database_version": 8,
"foreign_keys": true,
"issues": []
}
Zero-friction runtime telemetry interceptor.
codegraph run npm run dev # or codegraph run uvicorn main:app --reload
| Flag | Description |
|---|---|
| --sample-rate <float> | Trace sampling rate (0.0 to 1.0, default 1.0) |
>> Dev server active on port 8000 [CodeGraph Runtime Interceptor: Captured 14 HTTP spans -> .codegraph/runtime.sqlite3]
Run the Model Context Protocol (MCP) server over stdio or SSE HTTP.
codegraph serve . --transport sse --port 8765
| Flag | Description |
|---|---|
| --profile <name> | Tool profile (core | minimal | agent | developer | full) |
| --transport, -t <stdio|sse> | Transport layer (default: stdio) |
| --host <str> | Host for SSE server (default: 127.0.0.1) |
| --port, -p <int> | Port for SSE server (default: 8765) |
CodeGraph MCP server running on http://127.0.0.1:8765/sse (62 tools registered)
Safely terminate active CodeGraph background processes and release SQLite file locks.
codegraph stop --json
| Flag | Description |
|---|---|
| --all, -a | Stop all CodeGraph processes across all repositories |
| --timeout <sec> | Graceful shutdown timeout before SIGKILL |
| --json | Output machine-readable JSON |
{
"status": "ok",
"stopped_count": 1,
"stale_cleaned_count": 0
}
Idempotently detect and configure AI coding agents.
codegraph install --yes --target auto --location local
| Flag | Description |
|---|---|
| --target, -t <auto|all|agent> | Target specific agents |
| --location, -l <local|global> | Project (.cursor/mcp.json) vs user global (~/.claude.json) |
| --yes, -y | Non-interactive confirmation |
| --dry-run | Preview changes without writing |
Configured Claude Code (CLAUDE.md, .mcp.json) Configured Cursor (.cursor/mcp.json, .cursorrules) Configured Antigravity (.agents/mcp_config.json, AGENTS.md)
Search symbols and text chunks with AST-verified evidence.
codegraph search "create_order" -r .
| Flag | Description |
|---|---|
| --repository, -r <path> | Repository path |
| --top_k <int> | Number of results to return (default: 10) |
| --json | Machine-readable JSON output |
Found 1 symbol match: src/app/orders.py:42 function create_order(user_id: int, items: list) -> Order
Discover HTTP endpoints with composed router mount prefixes.
codegraph routes -r . --limit 3
| Flag | Description |
|---|---|
| --limit <int> | Bounded pagination limit (default: 50) |
| --offset <int> | Pagination offset (default: 0) |
| --json | Output routes as JSON |
Found 3 route(s):
[GET] /api/v1/health -> health_check (src/api.py:14)
[POST] /api/v1/orders -> create_order (src/orders.py:42)
[GET] /api/v1/users/{id} -> get_user (src/users.py:88)
Trace a symbol definition, callers, and callees with explicit confidence labels.
codegraph trace OrderService.create_order -d 2
| Flag | Description |
|---|---|
| -d, --depth <int> | Traversal depth (default: 1) |
| --json | Output call hierarchy as JSON |
Symbol: OrderService.create_order (src/services/order.py:28)
▲ Callers (1):
- [AST_VERIFIED] api.create_order_endpoint (src/api.py:52)
▼ Callees (2):
- [AST_VERIFIED] UserRepository.get_by_id (src/db/users.py:15)
- [AST_VERIFIED] OrderRepository.insert (src/db/orders.py:40)
Compile token-budgeted ContextPacket for an AI agent task.
codegraph context "fix order validation error" --intent DEBUG
| Flag | Description |
|---|---|
| --intent <str> | Task intent (UNDERSTAND | DEBUG | TRACE | REVIEW | IMPACT) |
| --max-tokens <int> | Token limit (default: 8000) |
| --json | Output serialized ContextPacket |
ContextPacket compiled (540 tokens, reduction: 78.4%): - 4 confirmed symbols, 2 database tables, 1 covering test
Verify repository privacy boundaries and ensure no sensitive data is indexed.
codegraph privacy .
| Flag | Description |
|---|---|
| --json | Output privacy audit as JSON |
Privacy Audit PASSED: 0 sensitive files indexed, 0 exposed secrets found.
Track Git branch, HEAD commit, indexed commit, and working-tree modifications.
codegraph git-state
| Flag | Description |
|---|---|
| --repository, -r <path> | Repository path |
| --json | Output git state as JSON |
Git Repository: /path/to/repo Branch: main Current HEAD: 3d71eca Indexed HEAD: 3d71eca Freshness: CLEAN Working Tree: 0 modified, 0 untracked
Compute structural AST-level difference between Git revisions, commits, or branches.
codegraph git-diff HEAD~1 HEAD
| Flag | Description |
|---|---|
| --branch, -b | Perform hierarchical branch architecture comparison |
| --json | Output structural diff as JSON |
Structural Git Diff (HEAD~1 -> HEAD): Modified Files: 2 Added Symbols: 3 (OrderValidator.validate_currency, ...) Modified Symbols: 1 (PaymentGateway.charge) Affected Routes: 1 (POST /api/v1/orders/pay)
Compute deep downstream change impact across callers, callees, framework routes, tests, and DB.
codegraph git-impact --tree
| Flag | Description |
|---|---|
| --tree, -t | Display visual impact tree |
| --depth, -d <int> | Max caller traversal depth (default: 2) |
| --max-results, -m <int> | Max items per category (default: 30) |
| --json | Output impact as JSON |
Impact Tree for commit 3d71eca:
└── src/services/auth.py (AuthService.verify_token)
├── [CALLER] api.routes.auth (login_handler)
│ └── [ROUTE] POST /api/v1/auth/login
├── [DB_WRITER] models.user (update_last_login)
└── [TEST] tests/test_auth.py::test_verify_token
Detect semantic and contract merge conflicts between branches before merge.
codegraph git-conflicts main feature-payments
| Flag | Description |
|---|---|
| --repository, -r <path> | Repository path |
| --json | Output conflicts as JSON |
Semantic Conflict Analysis (main <-> feature-payments): [CRITICAL] Branch 'feature-payments' registers route 'POST /api/checkout' pointing to handler 'process_checkout', which was deleted in 'main'.
Validate whether compiled context remains VALID, PARTIALLY_STALE, or STALE against repository changes.
codegraph check-freshness "refactor payment flow"
| Flag | Description |
|---|---|
| --repository, -r <path> | Repository path |
| --json | Output freshness report as JSON |
{
"status": "VALID",
"head_commit": "3d71eca",
"context_files_changed": 0,
"unrelated_files_changed": 2,
"recommendation": "SAFE_TO_USE"
}
Trace deterministic symbol evolution across Git history: introduced, modified, moved, renamed, or deleted.
codegraph symbol-history resolve_target
| Flag | Description |
|---|---|
| -f, --file <str> | File path where symbol is located |
| -m, --max-commits <int> | Max commits to inspect (default: 15) |
| --json | Output symbol history as JSON |
Symbol History: resolve_target - [INTRODUCED] 3d71eca (feat: add TargetResolver for v2.1) - [MODIFIED] 9da7eec (refactor: support Class.method resolution) Confidence: AST_VERIFIED
Inspect Roblox Client <-> Server RemoteEvent and RemoteFunction boundaries.
codegraph roblox remotes .
| Flag | Description |
|---|---|
| --json | Output RemoteEvent / RemoteFunction boundaries as JSON |
Roblox Remotes (2):
[RemoteEvent] ReplicatedStorage.Remotes.Inventory
▲ Client Dispatchers: ClientController:EquipItem (src/client/controller.luau:14) [ROJO_VERIFIED]
▼ Server Handlers: InventoryService:Init (src/server/services/InventoryService.luau:23) [ROJO_VERIFIED]
List Rojo DataModel virtual paths mapped to physical Luau files and inspect REQUIRES_MODULE edges.
codegraph roblox modules .
| Flag | Description |
|---|---|
| --json | Output Rojo virtual-to-physical module mappings and requires as JSON |
Rojo Virtual Modules: ReplicatedStorage.Shared.Types -> src/shared/Types.luau [ROJO_VERIFIED] ServerScriptService.Server.Services.InventoryService -> src/server/services/InventoryService.luau [ROJO_VERIFIED]
Trace end-to-end Roblox Client -> Remote -> Server -> Knit/Flamework -> DataStore execution routes.
codegraph roblox routes .
| Flag | Description |
|---|---|
| --json | Output end-to-end Roblox client-to-server routes as JSON |
Roblox Client ↔ Server Routes:
ClientController:EquipItem
--[CLIENT_DISPATCHES_REMOTE]--> ReplicatedStorage.Remotes.Inventory
--[SERVER_HANDLES_REMOTE]-----> InventoryService:Init
--[WRITES_PERSISTENCE]--------> persistence.roblox.datastore.PlayerInventory_v1
Detect uncalled dead symbols, zombie HTTP routes, and orphaned database tables.
codegraph dead-code . --json
| Flag | Description |
|---|---|
| --repository, -r <path> | Repository path |
| --max-symbols, -m <int> | Max dead symbols to display (default: 50) |
| --json | Output raw JSON report |
CodeGraph Dead Code & Zombie Route Report for my-app:
Runtime Telemetry: PRESENT
Total Flagged: 7
Dead Symbols: 4
Zombie Routes: 2
Orphaned Tables: 1
Run embedded OpenTelemetry (OTLP/HTTP) trace receiver streaming into .codegraph.sqlite3.
codegraph otel-listen --port 4318
| Flag | Description |
|---|---|
| --port, -p <int> | Listening port (default: 4318) |
| --host, -h <str> | Listening host (default: 127.0.0.1) |
| --repository, -r <path> | Repository path |
CodeGraph OTLP HTTP Receiver listening on http://127.0.0.1:4318/v1/traces Export traces using: export OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:4318 [OTLP] Ingested trace batch: 12 spans -> 8 runtime graph edges
Run Language Server Protocol (LSP) server over stdio for IDE integration.
codegraph lsp .
| Flag | Description |
|---|---|
| --repository, -r <path> | Repository path |
[CodeGraph LSP] JSON-RPC stdio server listening for client requests (pid=45210)
Atomically preview or apply multi-file semantic patches with pre-flight syntax validation and rollback.
codegraph refactor patch patch_spec.json --dry-run
| Flag | Description |
|---|---|
| --dry-run, -d | Preview patch diff and affected symbols without modifying disk |
| --repository, -r <path> | Repository path |
| --json | Output patch transaction result as JSON |
{
"status": "APPLIED",
"files_modified": 2,
"hunks_applied": 3,
"rollback_manifest": ".codegraph/rollback_manifest.json"
}
Generate semantic PR review evaluating structural diffs, contract breaks, and tests.
codegraph pr-review main HEAD
| Flag | Description |
|---|---|
| --output-file, -o <path> | Write markdown review to file |
| --json | Output structured JSON report |
## 🔍 CodeGraph Semantic PR Review Verdict: 🟢 APPROVED Files Changed: 2 | Symbols Modified: 1 | Affected Routes: 1
Generate production-ready test scaffolding with fixtures and dependency mocks.
codegraph generate-tests process_payment -f pytest
| Flag | Description |
|---|---|
| --framework, -f <str> | Target framework (pytest, jest, testez) |
| --output-file, -o <path> | Save generated test suite to file |
| --json | Output structured JSON scaffold |
Generated pytest Test Scaffold for process_payment: Target: src/services/payment.py Detected Mocks: DB_SESSION via database.query
Discover and catalog federated repositories in a multi-repo microservice workspace.
codegraph federate scan .
| Flag | Description |
|---|---|
| --json | Output structured JSON report |
Federated Workspace: /workspace Discovered Repositories (3): - [users-service] Symbols: 450 | Routes: 12 - [orders-service] Symbols: 820 | Routes: 18
Resolve cross-repository HTTP and RPC service-to-service links across microservices.
codegraph federate routes .
| Flag | Description |
|---|---|
| --json | Output structured JSON links |
Cross-Repository Route Links: [STATIC_VERIFIED] frontend:src/api.ts (fetchUsers) -> users-service:src/api.py (list_users)
Store agent debugging trajectory or architectural decision into persistent memory.
codegraph memory store -t "Fixed Auth Skew" -r "Added clock leeway" -c BUG_FIX
| Flag | Description |
|---|---|
| --title, -t <str> | Summary of debugging session |
| --resolution, -r <str> | Applied fix or architectural decision |
| --category, -c <str> | BUG_FIX, ARCHITECTURE_DECISION, TEST_PATTERN |
| --symptoms, -s <str> | Observed error trace or symptom |
Stored Agent Memory Record [mem_4a81b92c]: Category: BUG_FIX Title: Fixed Auth Skew
Search past agent debugging memories and decisions using FTS5 BM25 ranking.
codegraph memory search "auth token expired"
| Flag | Description |
|---|---|
| --category, -c <str> | Filter by category |
| --limit, -l <int> | Max records (default: 5) |
| --json | Output structured JSON |
Found 1 Agent Memory Record(s) for "auth token expired": [BUG_FIX] Fixed Auth Skew (Relevance: 0.95) Resolution: Added clock leeway
Scaling Benchmarks
Empirically measured scaling metrics across codebases from 10,000 to over 1,000,000 lines of code.
| Scale | Cold Index Time | Warm Re-index | Query Latency | Database Size | Memory Footprint |
|---|---|---|---|---|---|
| Small (10k LOC) | 0.42 s | 0.08 s | 12 ms | 2.4 MB | < 35 MB |
| Medium (100k LOC) | 2.85 s | 0.31 s | 24 ms | 18.2 MB | < 85 MB |
| Large (500k LOC) | 11.40 s | 1.15 s | 42 ms | 76.5 MB | < 180 MB |
| Monorepo (1M+ LOC) | 23.10 s | 2.40 s | 58 ms | 152.0 MB | < 320 MB |