Skip to main content
Glama

reindex_documents

Indexes or reindexes knowledge base documents in the background, supporting incremental updates, smart re-embedding, full rebuilds, and resume of interrupted runs.

Instructions

Index or reindex all documents in the knowledge base (runs in background).

No flags — incremental pass: index new or changed files, skip unchanged ones, prune deleted sources. Use after filesystem edits outside add_document/update_document. force — smart reindex: re-embed every file, unchanged ones included, and rebuild BM25. Slow on a large corpus; use after changing the query/passage prefixes or chunking settings. full_rebuild — nuclear rebuild (delete + re-embed). Use only after embedding-model change or index corruption. Mutually exclusive with resume. resume — pick up an interrupted smart reindex from data/reindex_checkpoint.json. Falls back to a fresh smart run silently if the checkpoint is missing/corrupt/drifted (v4.8.0 Fase 4).

Returns a JSON envelope. Poll get_reindex_status() until reindex.active becomes false. Add/update/URL tools already auto-index — use these flags only for the recovery/rebuild scenarios above.

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_documents"
  }
}

Input Schema

NameRequiredDescriptionDefault
forceNo
resumeNo
full_rebuildNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv4.8.1
    • addedInput schema / properties / resume
      Added value: +{
      +  "default": false,
      +  "title": "Resume",
      +  "type": "boolean"
      +}
  2. First observedv3.0.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so: it discloses background execution, that force re-embeds everything and rebuilds BM25 and is slow on large corpora, that full_rebuild is destructive (delete + re-embed), that resume and full_rebuild are mutually exclusive, and that resume silently falls back if the checkpoint is missing/corrupt/drifted. It even names the checkpoint path and tells the agent to poll get_reindex_status() until reindex.active is false.

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 summary sentence, then one clearly delimited block per flag ordered by escalation, then return/polling advice and the when-not-to-use note at the end. Nearly every sentence earns its place; the version stamp '(v4.8.0 Fase 4)' and the parenthetical about the checkpoint file name are the only extraneous tokens.

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?

For a destructive, long-running, background operation this description covers trigger conditions, cost, irreversibility, flag interactions, how to observe completion, and the output envelope. Since an output schema exists and polling is delegated to get_reindex_status, nothing essential is missing.

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 0% for three bare booleans, so the description must compensate and largely does: each flag's cost, effect, prerequisite scenario, and mutual exclusivity is spelled out, and the all-false default is defined as an incremental prune/index pass. The only gap is that combinations other than full_rebuild+resume (e.g. force+resume) are left undefined, which is minor for three flags whose individual semantics are this well documented.

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?

States a specific verb and resource ('Index or reindex all documents in the knowledge base') plus the key execution trait ('runs in background'). It also distinguishes the tool from the auto-indexing siblings (add_document/update_document), so an agent can tell which path to take without opening a schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use guidance per flag: incremental 'after filesystem edits outside add_document/update_document', force 'after changing the query/passage prefixes or chunking settings', full_rebuild 'only after embedding-model change or index corruption', resume 'interrupted smart reindex'. It also states when NOT to use it ('Add/update/URL tools already auto-index — use these flags only for the recovery/rebuild scenarios above'), which is exactly the exclusion guidance the dimension asks for.

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