Skip to main content
Glama

Index repository

index_repository

Index a repository into a knowledge graph for code intelligence. Supports full, fast, and cross-repo-intelligence modes for efficient codebase analysis.

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.

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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior3/5

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

No annotations provided, so description carries full burden. It reveals the mode-specific behavior (cross-repo-intelligence skips extraction) and implies the tool performs LSP analysis (from schema descriptions). However, it doesn't disclose general indexing side effects (e.g., graph modification, performance impact) or permission requirements.

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?

Two sentences, no superfluous wording. First sentence states core purpose. Second sentence immediately details the special mode and its requirement. Information is front-loaded and to the point.

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

Completeness4/5

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

Given 5 parameters (1 required, 1 enum) and an output schema (not shown), the description adequately covers the main indexing purpose and special mode. It doesn't explain return values, but the existence of an output schema reduces that need. Missing overall behavioral description of what 'index' entails (e.g., creates graph entities), but still serviceable.

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%, baseline 3. Description adds value beyond schema: clarifies that target_projects is required for cross-repo-intelligence mode, emphasizes prerequisite of fresh indexes, and explains name parameter's encoding behavior ('Non-ASCII bytes are encoded and unsafe path characters are normalized').

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?

Clearly states 'Index a repository into the knowledge graph' with a specific verb and resource. Distinguishes from sibling tools (query graph, search code) by focusing on indexing. The special mode 'cross-repo-intelligence' is explicitly described, differentiating it from the default indexing behavior.

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?

Provides explicit context for the 'cross-repo-intelligence' mode: 'skip extraction, only match Routes/Channels... Requires target_projects param. Ensure target projects have fresh indexes first.' While it doesn't state when not to use other modes, the schema descriptions for each mode offer additional implicit guidance.

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