ollama_corpus_index
Index corpus. Build a persistent named corpus. Pass name + paths: string[]; the server chunks, embeds, stores the corpus at ~/.ollama-intern/corpora/ollama_corpus_refresh — it reconciles corpus vs manifest and reports drift.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
name |
string | yes | — | Corpus name (e.g. ‘memory’, ‘canon’, ‘handbook’). Maps to a file under ~/.ollama-intern/corpora/. |
paths |
string[] | yes | — | Absolute file paths to include in the corpus. Pass an explicit list of files — corpus_index does NOT walk directories; you enumerate. Unchanged files are reused from the existing corpus by sha256. |
chunk_chars |
integer | no | — | Chars per chunk (default 800). |
chunk_overlap |
integer | no | — | Overlap between adjacent chunks (default 100). |
Full input schema
Section titled “Full input schema”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 name (e.g. 'memory', 'canon', 'handbook'). Maps to a file under ~/.ollama-intern/corpora/." }, "paths": { "minItems": 1, "type": "array", "items": { "type": "string", "minLength": 1 }, "description": "Absolute file paths to include in the corpus. Pass an explicit list of files — corpus_index does NOT walk directories; you enumerate. Unchanged files are reused from the existing corpus by sha256." }, "chunk_chars": { "description": "Chars per chunk (default 800).", "type": "integer", "minimum": 100, "maximum": 8000 }, "chunk_overlap": { "description": "Overlap between adjacent chunks (default 100).", "type": "integer", "minimum": 0, "maximum": 4000 } }, "required": [ "name", "paths" ]}Envelope
Section titled “Envelope”Every tool returns the standard envelope — tier_used, model, tokens_in/tokens_out, elapsed_ms, backend provenance, warnings. See Envelope & tiers.
Source
Section titled “Source”Schema + handler: src/tools/corpusIndex.ts · registration: src/index.ts
Back to the Tool Reference.