Skip to main content
Glama

Update the knowledge base index

rhebok_update_index
Idempotent

Updates the knowledge base index by reading new or changed files, embedding pending sections, or compacting the index to repair search and reclaim disk space.

Instructions

Update the user's knowledge base index: read new and changed files, embed sections that are still waiting, or compact the index.

Use it when the user has just added or edited files that a search does not find, when rhebok_get_status shows vectors_pending above 0, or when a search error asks for a compaction. Do not call it routinely: rhebok already indexes at the start of every session. Check rhebok_get_status first to see whether a run is already going.

Parameters: mode "changes" (the default) stats every configured source, reads only files whose size or modification time changed, and removes documents whose file is gone. "backfill" embeds waiting sections and starts no new batch after two minutes, though the batch under way and the final rebuild of the index can run past that; call it again while vectors_pending stays above 0. "compact" rebuilds the index from its own stored rows, which repairs a search that refuses its index and reclaims disk space, without reading any file or embedding anything.

Behavior: "changes" and "backfill" send new text to the configured embedding server, which can take minutes for many files. Search answers from the previous index until the new one is swapped in. While another index run holds the lock, it refuses and changes nothing.

Returns: the documents added, updated and deleted and the sections read, or for a backfill the sections embedded and still waiting; error says why a run failed or was refused.

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": "rhebok_update_index"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNo"changes" (the default) reads new and changed files. "backfill" embeds the sections still waiting for an embedding. "compact" rebuilds the index from its own stored rows without embedding anything.

Output Schema

NameRequiredDescriptionDefault
okYesTrue when the run finished and its index is now live.
modeYesThe mode that ran: "changes", "backfill" or "compact".
addedYesDocuments read for the first time.
errorYesWhy the run failed or was refused. Null when `ok` is true.
chunksYesFor "changes", the sections of the documents this run read, so 0 when nothing changed; for "compact", every section in the index. Null for "backfill".
deletedYesDocuments removed because their file is gone.
updatedYesDocuments re-read because their file changed.
embeddedYesSections embedded by a "backfill" run. 0 for the other modes.
vectors_pendingYesSections still waiting for an embedding after a "backfill" run; call it again while this is above 0. Null for the other modes.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.4

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses that changes/backfill submit text to an embedding server and can take minutes, that searches keep answering from the previous index until the swap, and that a concurrent run holding the lock causes a no-op refusal. It also bounds backfill's batching (no new batch after two minutes, in-flight batch may exceed it) and states compact reads and embeds nothing.

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?

Well structured into purpose, when-to-use, parameters, behavior, and returns, with the key trigger front-loaded. The closing "Returns" sentence is largely redundant given an output schema exists, and the mode-by-mode prose is dense enough that it could be tightened slightly.

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 one-parameter mutation tool that triggers an expensive embedding pipeline, the definition covers timing, concurrency, atomicity, per-mode side effects, and failure reporting. An agent has everything needed to decide whether and how to call it; only the return-value recap is superfluous.

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 coverage is already 100%, yet the description still adds real meaning: it restates the default, explains that "changes" stats every source and prunes documents whose file is gone, and clarifies that "backfill" should be re-invoked while `vectors_pending` remains above 0. These are operational semantics the enum descriptions alone do not convey.

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?

Opens with a specific verb+resource ("Update the user's knowledge base index") and immediately enumerates the three concrete operations it covers: reading new/changed files, embedding pending sections, compacting. It is clearly distinguishable from siblings like rhebok_search_knowledge and rhebok_get_status, both of which it names.

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 positive triggers (files added/edited but search misses them, `vectors_pending` above 0, a search error requesting compaction) and an explicit negative rule ("Do not call it routinely: rhebok already indexes at the start of every session"), plus a pre-check instruction to consult rhebok_get_status first.

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