Skip to content

ollama_corpus_refresh

Refresh corpus. Reconcile a named corpus against its manifest (intent vs reality). Single arg: name. The manifest’s declared paths, chunk params, and embed model are the source of truth — refresh doesn’t accept them. Returns a drift report: added / changed / unchanged / deleted / missing (per-path lists) plus reused / reembedded / dropped (chunk-level counts) plus no_op. Idempotent: a no-change refresh is fast, boring, and makes zero embed calls.

Parameter Type Required Default Description
name string yes Corpus to refresh. Must already have a manifest (created by ollama_corpus_index). Call ollama_corpus_list to see which corpora exist.
retry_failed boolean no When true, re-attempt any paths recorded as failed in the manifest (e.g. symlink rejects, TOCTOU races, oversized files). Default false — a normal refresh honors only the declared manifest paths. Use after you’ve fixed the underlying cause (resized the file, replaced the symlink, fixed permissions) to retry without re-indexing the whole corpus.

The JSON Schema below is generated from the same zod schema the server validates against at the wire — it cannot drift from runtime behavior.

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1,
"pattern": "^[a-zA-Z0-9_-]+$",
"description": "Corpus to refresh. Must already have a manifest (created by ollama_corpus_index). Call ollama_corpus_list to see which corpora exist."
},
"retry_failed": {
"description": "When true, re-attempt any paths recorded as failed in the manifest (e.g. symlink rejects, TOCTOU races, oversized files). Default false — a normal refresh honors only the declared manifest paths. Use after you've fixed the underlying cause (resized the file, replaced the symlink, fixed permissions) to retry without re-indexing the whole corpus.",
"type": "boolean"
}
},
"required": [
"name"
]
}

Every tool returns the standard envelope — tier_used, model, tokens_in/tokens_out, elapsed_ms, backend provenance, warnings. See Envelope & tiers.

Schema + handler: src/tools/corpusRefresh.ts · registration: src/index.ts


Back to the Tool Reference.