Skip to main content
Glama

cgis_ingest

Scan a project directory to extract symbols, resolve links, and build or refresh a portable code knowledge graph in SQLite. Incremental updates keep the graph current without full rescans.

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
db_pathNoWhere 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
full_rebuildNoRe-scan every file from scratch instead of the incremental default.
project_pathYesRoot directory of the project to scan. A relative path resolves against the MCP server's working directory.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.21.1
    • addedInput schema / properties / db_path / description
      Added value: +"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."
    • addedInput schema / properties / full_rebuild / description
      Added value: +"Re-scan every file from scratch instead of the incremental default."
    • addedInput schema / properties / project_path / description
      Added value: +"Root directory of the project to scan. A relative path resolves against the MCP server's working directory."
  2. First observedv0.21.0

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden, and it does so thoroughly. It discloses that ingest is incremental by default, that the whole graph is rebuilt when resolution changes occur, that full_rebuild=True forces a full rescan, that the graph is portable due to FQN normalisation, and that cgis will not create parent directories.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose and then adds necessary caveats and behavioral details in a logical order. Every sentence contributes either to usage, path constraints, or incremental rebuild semantics; nothing is redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the output schema exists and the parameter count is only three, the description is complete. It covers the operation, default behavior, rebuild behavior, path constraints, and even what the summary reports, leaving no critical gap for invoking the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3, but the description adds substantial meaning beyond the schema: db_path constraints are elaborated, the incremental-vs-full-rebuild behavior is explained, and the relative-path resolution for both db_path and project_path is clarified. This exceeds what the schema alone provides.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a concrete action chain — scan a directory, extract symbols, resolve links, and build the graph DB — and explicitly says it initializes or refreshes a project's code knowledge graph. This clearly separates it from the sibling analysis tools like cgis_trace_flow or cgis_analyze_impact.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives a clear usage context: 'Use this to initialise or refresh the code knowledge graph for a project.' It does not explicitly enumerate when not to use it or name alternative tools, but the context is specific enough that an agent can identify the appropriate situation.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.