Skip to main content
Glama

reindex

Re-walk and re-parse project files into the database, using content hashes to process only changed files. Use after git pull, branch switches, or external edits to refresh embeddings and import graph.

Instructions

Re-walk, re-parse, and re-index project files into the database. Detects changed files via content hash and only re-processes what changed. Eagerly populates file and identifier embeddings unless no_embed=true or CONTEXTPRO_REINDEX_NO_EMBED is set. Use after git pull, branch switch, or external edits. Builds the import graph for related/test_map tools.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "reindex"
  }
}

Input Schema

NameRequiredDescriptionDefault
rootNoAbsolute project root. Omit only where this session started; required elsewhere and on every subagent call.
forceNoForce re-process all files, ignoring cache. Default: false.
no_embedNoSkip corpus embedding generation. Search does not generate corpus embeddings; it uses existing vectors or lexical fallback. Configure an embedding provider and run reindex with no_embed:false to populate vectors (also unset CONTEXTPRO_REINDEX_NO_EMBED). Default: false.
auto_hubsNoGenerate feature-hub labels (one chat-model call per hub). Off by default to keep reindex fast and free. Or set CONTEXTPRO_AUTO_HUBS=1.
target_pathNoScope reindex to a specific directory (relative to root).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.6.0
    • changedInput schema / properties / root / description
      Previous value: -"Absolute project root. Required with linked worktrees; subagents must pass their own worktree root on every call."New value: +"Absolute project root. Omit only where this session started; required elsewhere and on every subagent call."
  2. First observedv1.4.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations declare the safety profile (non-read-only, non-destructive, non-open-world), so the description's job is to add behavior, and it does: content-hash change detection means partial work, embeddings are populated eagerly by default, and the import graph is rebuilt as a side effect other tools depend on. It does not estimate cost/duration or say whether concurrent edits during a run are safe.

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?

Four front-loaded sentences with the core action first, then caching behavior, then embedding side effects, then the downstream artifact. Every sentence carries information, though the embedding sentence is dense enough to require a second read.

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 a five-parameter mutation tool with no required inputs and no output schema, the description covers trigger conditions, incremental semantics, expensive side effects, and downstream consumers. A reader still lacks a sense of runtime cost or what the tool returns, but the essentials for correct invocation are present.

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%, so the baseline is 3, but the description adds meaning beyond the field docs by framing no_embed as a default-on embedding pass and by tying the env var override to that default. It says nothing extra about root, force, auto_hubs, or target_path, which is acceptable given full schema coverage.

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?

"Re-walk, re-parse, and re-index project files into the database" gives a specific verb triad plus the resource and destination. It also names distinct sub-behaviors (import graph build, embedding population) so an agent can tell this apart from read-only siblings like search, grep, or skeleton.

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?

"Use after git pull, branch switch, or external edits" states concrete triggering conditions rather than leaving timing to inference. There is no explicit when-not or named alternative, but no sibling tool overlaps enough to need one.

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