build_codebase_graph
Builds an indexed AST knowledge graph for a repository, mapping classes, functions, and import dependencies into dependency maps and structural summaries so coding agents can explore and refactor code before querying it.
Instructions
Generates and indexes the AST knowledge graph for a repository, creating precomputed dependency maps, god classes, and structural summaries in graphify-out/. Mutating file operation: creates or updates only the local graphify-out/ artifact directory inside the target repository root; leaves all existing source code files unmodified. Requires zero network access or external credentials. If the external graphify CLI is installed in PATH, invokes it; otherwise, automatically executes a native, zero-dependency Python AST parser to extract classes, functions, and import dependencies.
When to use: Call before deep codebase refactoring or exploration when inspect_codebase_graph indicates no graph exists. When NOT to use: Do not use if graphify-out/ is already active and up-to-date; use query_codebase_graph to query the existing graph directly. Returns: Build report containing extracted node count, edge count, detected god classes, and path to the generated graphify-out/ directory.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "build_codebase_graph"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_path | No | Absolute or relative path to the target repository root where graphify-out/ will be built. If omitted, empty string, or '.', defaults to the current working directory. | |
| force_rebuild | No | Whether to overwrite an existing graphify-out/ directory if already present. Defaults to false. |