index_graph
Build a structural knowledge graph of a codebase, extracting files, functions, classes, and their relationships to enable semantic code search and analysis.
Instructions
Build (or rebuild) a knowledge graph for a codebase.
Walks the directory using the same skip rules as index_codebase, extracts
structural nodes (files, functions, classes) and edges (contains, calls,
imports, inherits) using tree-sitter, and persists the graph to disk.
This is independent of the vector index — you can run index_graph before
or after index_codebase.
Args:
path: Absolute path to the codebase root directory.
force: If True, rebuild the graph even if one already exists.
Returns:
Summary: node count, edge count, files processed.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "index_graph"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| force | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |