cgis_ingest
Scan a project directory to extract symbols, resolve links, and build or refresh a portable SQLite code knowledge graph for AI agents. Incremental updates are default.
Instructions
Scan a local directory, extract all symbols, resolve links, and build the graph DB.
Use this to initialise or refresh the code knowledge graph for a project.
Node FQNs are normalised relative to the workspace root so the graph is
portable across machines.
``db_path`` must name a database — it has to end in ``.db``, ``.sqlite`` or
``.sqlite3``, live in a directory that already exists, and not point at an
existing file that is not a SQLite database. cgis will not create parent
directories.
By default the ingest is **incremental**: only changed/new files are
re-scanned, and the summary reports both what changed this run and the
whole-graph total. When a change alters what other files resolve against — a
renamed, removed or added symbol, a deleted or new file, a changed base class
or re-export — the incremental run rebuilds the whole graph itself, so edges
in unchanged files never point at symbols that no longer exist. Set
``full_rebuild=True`` to force a re-scan of every file from scratch.
Data keys are opt-in (``data_keys=True``): they cost every ingest time and
graph size, and make JSON and YAML edits mark the graph stale.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| db_path | No | Where to write the graph: must end in .db, .sqlite or .sqlite3, in a directory that already exists, and must not be an existing non-SQLite file. A relative path resolves against the server's working directory. | graph.db |
| data_keys | No | Extract data keys (Python dict keys, JSON and YAML declarations) for cgis_diff_check. Off by default. Left out, an existing graph keeps the mode it was built in, and a new one takes CGIS_DATA_KEYS=1 from the server's environment. Switching it rebuilds the graph. | |
| full_rebuild | No | Re-scan every file from scratch instead of the incremental default. | |
| project_path | Yes | Root directory of the project to scan. A relative path resolves against the MCP server's working directory. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |