Skip to main content
Glama

Index repository

index_repository
Idempotent

Index a repository into a queryable knowledge graph for code intelligence. Supports full, moderate, fast, and cross-repo modes to map calls, routes, and dependencies.

Instructions

Index a repository into the knowledge graph. Special mode 'cross-repo-intelligence': skip extraction, only match Routes/Channels across projects to create CROSS_HTTP_CALLS/CROSS_ASYNC_CALLS/CROSS_CHANNEL edges. Requires target_projects param. Ensure target projects have fresh indexes first. COVERAGE: the response reports files that were NOT fully indexed — 'skipped' (not indexed at all: oversized/read/parse failures) and 'parse_partial' (indexed, but constructs inside the listed line ranges could not be parsed and MAY be missing from the graph). The embedded lists carry counts plus a FEW EXAMPLES only; the complete lists are in the per-run 'logfile' (path in the response) and queryable any time via index_status or structurally via query_graph(graph="missed"). Both signals are best-effort: absence of a flag is NOT a completeness guarantee; prefer grep inside flagged ranges. Separately, 'excluded' + 'not_indexed_files' list what was deliberately NOT indexed (gitignore/.cbmignore/skip-lists) — by design, not failures.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoAll modes run type-aware LSP call/usage resolution (per-file + cross-file). full: all files + similarity/semantic edges. moderate: filtered files + similarity/semantic. fast: filtered files, no similarity/semantic. cross-repo-intelligence: match Routes/Channels across projects.full
nameNoOverride the derived project name. Non-ASCII bytes are encoded and unsafe path characters are normalized.
repo_pathYesPath to the repository
persistenceNoWrite compressed artifact to .codebase-memory/graph.db.zst for team sharing. Teammates can bootstrap from the artifact instead of full re-indexing.
target_projectsNoProjects to search for cross-repo links (cross-repo-intelligence mode). Use ["*"] for all indexed projects. Run list_projects to see available projects.
Behavior5/5

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

The description goes far beyond annotations by explaining coverage reporting (skipped, parse_partial, excluded), best-effort nature of flags, where complete lists reside (logfile, index_status, query_graph), and what counts as a failure vs. by-design exclusion. This adds rich behavioral context that annotations (idempotentHint, readOnlyHint) do not provide.

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

Conciseness4/5

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

The description is long but every sentence adds value—covering main action, special mode, coverage interpretation, and exclusion semantics. It is organized with clear labels ('COVERAGE:', 'excluded') and front-loads the primary verb. Slightly verbose, but not wasteful given the tool's complexity.

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?

Despite no output schema, the description fully compensates by detailing what the response contains (skipped/parse_partial lists, logfile path), how to query missed items, and what constitutes deliberate exclusion. It addresses failure modes, best-effort caveats, and cross-project prerequisites, making it complete for a complex indexing tool.

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

Parameters4/5

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

Schema coverage is 100%, but the description enhances parameter meaning: it explains the cross-repo-intelligence prerequisite for target_projects, clarifies mode behavior beyond enum values, and describes persistence artifact usage. It stops short of defining every param's exact syntax but meaningfully supplements the schema.

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 opens with a clear, specific verb+resource: 'Index a repository into the knowledge graph.' It also details a special mode ('cross-repo-intelligence') with its distinct purpose, distinguishing this ingestion tool from query/read siblings like search_graph or index_status.

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?

It explicitly states when to use the cross-repo-intelligence mode (requires target_projects, needs fresh indexes on target projects). It also implies general indexing workflow by describing mode variants and prerequisites, though it doesn't explicitly contrast with alternatives like detect_changes or check_index_coverage for refresh scenarios.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DeusData/codebase-memory-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server