Skip to main content
Glama

index_repository

Idempotent

Index a code repository into a persistent knowledge graph for code intelligence. Supports semantic modes, cross-repo linking, and async background indexing.

Instructions

Index a repository. full/moderate add semantics; fast omits them; cross-repo-intelligence links services. Reports coverage gaps. Waits for the whole index by default; a large repo can exceed a client's per-call deadline. async:true starts (or joins) the index in the daemon and returns at once; poll with status:true (same repo_path) until state is succeeded, failed or cancelled. async needs a daemon that outlives the call: an MCP session or daemon start.

Input Schema

NameRequiredDescriptionDefault
modeNofull: all+semantic; moderate: filtered+semantic; fast: filtered only; cross-repo-intelligence: link services.full
nameNoName override; Non-ASCII bytes are encoded; unsafe characters normalized.
asyncNoStart the index in the background and return immediately; it keeps running if this call is cancelled or times out. Not with status or cross-repo-intelligence. Refused for a one-shot cli call that is the only client of a temporary daemon (run daemon start).
statusNoReport the running or last index job (queued/running/succeeded/failed/cancelled) instead of indexing. Pass the same repo_path (and name, if any) as the index call.
repo_pathYesRepository path
persistenceNoWrite .codebase-memory/graph.db.zst.
doc_candidatesNoDoc-code candidates; default: the doc_candidates setting, else on for full, off for moderate/fast.
target_projectsNoCross-repo targets; ["*"] means all.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.12.1
    • addedInput schema / properties / async
      Added value: +{
      +  "default": false,
      +  "description": "Start the index in the background and return immediately; it keeps running if this call is cancelled or times out. Not with status or cross-repo-intelligence. Refused for a one-shot cli call that is the only client of a temporary daemon (run daemon start).",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / doc_candidates
      Added value: +{
      +  "description": "Doc-code candidates; default: the doc_candidates setting, else on for full, off for moderate/fast.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / status
      Added value: +{
      +  "default": false,
      +  "description": "Report the running or last index job (queued/running/succeeded/failed/cancelled) instead of indexing. Pass the same repo_path (and name, if any) as the index call.",
      +  "type": "boolean"
      +}
  2. Changed5 schema fields changedv0.11.0
    • changedInput schema / properties / mode / description
      Previous value: -"All 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."New value: +"full: all+semantic; moderate: filtered+semantic; fast: filtered only; cross-repo-intelligence: link services."
    • changedInput schema / properties / name / description
      Previous value: -"Override the derived project name. Non-ASCII bytes are encoded and unsafe path characters are normalized."New value: +"Name override; Non-ASCII bytes are encoded; unsafe characters normalized."
    • changedInput schema / properties / persistence / description
      Previous value: -"Write compressed artifact to .codebase-memory/graph.db.zst for team sharing. Teammates can bootstrap from the artifact instead of full re-indexing."New value: +"Write .codebase-memory/graph.db.zst."
    • changedInput schema / properties / repo_path / description
      Previous value: -"Path to the repository"New value: +"Repository path"
    • changedInput schema / properties / target_projects / description
      Previous value: -"Projects to search for cross-repo links (cross-repo-intelligence mode). Use [\"*\"] for all indexed projects. Run list_projects to see available projects."New value: +"Cross-repo targets; [\"*\"] means all."
  3. Changed1 schema field changedv0.10.4
    • changedOutput schema / (root)
      Previous value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}New value: +null
  4. Changed2 schema fields changedv0.9.0
    • addedInput schema / properties / name
      Added value: +{
      +  "description": "Override the derived project name. Non-ASCII bytes are encoded and unsafe path characters are normalized.",
      +  "type": "string"
      +}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  5. First observedv1.0.0

TDQS

A4.2/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing non-obvious operational traits: the default call blocks until the whole index finishes and can blow a client's per-call deadline, async runs in the daemon and survives call cancellation/timeout, polling terminates at succeeded/failed/cancelled, and async requires a daemon that outlives the call (MCP session or `daemon start`). The idempotent/readOnly hints are silently consistent with re-indexing, and no annotation is contradicted.

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?

Front-loaded with the core action, then compact fragments that each carry information (mode semantics, async mechanics, daemon requirement). The telegraphic style ("full/moderate add semantics; fast omits them") is dense but parseable. Slightly clipped wording costs it the top score.

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?

For an 8-parameter mutation tool with no output schema, the description covers the essential decision points: mode selection, sync-vs-async, the polling workflow and its terminal states, and the daemon lifetime requirement. Remaining gaps are minor – it does not say what the index call returns on success or how long a typical index takes.

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 already 100%, so the baseline is 3, but the description adds real value: it explains what full/moderate/fast/cross-repo-intelligence mean in terms of semantics vs filtering, describes the async→status polling pairing including that the same repo_path/name must be reused, and notes the daemon constraint on async. It does not expand on doc_candidates or persistence beyond the schema text.

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

Purpose4/5

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

Opens with a specific verb+resource ("Index a repository") and immediately distinguishes the four mode behaviors (semantics, filtered, service linking). An agent knows exactly what the tool produces. It stops short of naming siblings like index_status or check_index_coverage, even though status:true overlaps with the former and "Reports coverage gaps" overlaps with the latter.

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?

Gives concrete when-to-use guidance: default blocks for the whole index, large repos may exceed a client deadline, so use async:true and poll with status:true. It also states exclusions (async not with status or cross-repo-intelligence) and the daemon prerequisite. It never routes the agent to the sibling index_status tool that covers the same polling job, so it is not a full 5.

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