Skip to content

ollama_research

Research over files. FLAGSHIP. Answer a question grounded in specific files. Takes FILE PATHS (not raw text) — reads and chunks locally, returns a digest with validated citations. Use this to understand a repo/doc without burning Claude context on the full content. Citations outside source_paths are stripped server-side; cited line_ranges that point past EOF have the range dropped (path is kept) with a warning. Returns honest grounding signals: weak: true when an answer has zero validated citations (likely ungrounded); abstained: true when the model explicitly refused (citations cleared); sources_address_question is tri-state (null when unknown).

Parameter Type Required Default Description
question string yes The question to answer.
source_paths any yes Files the answer must be grounded in. Nothing outside this list is allowed as a source.
max_words integer no Target answer length in words (default 300).
per_file_max_chars integer no Chars to read per file (default 40k).
model string no Optional per-call model override. When provided, overrides the tool’s tier-resolved model for this call. The tier’s timeout (TIER_TIMEOUT_MS) still applies. On timeout, fallback uses the tier-resolved model, NOT the override. Use for receipt-backed orchestration that requires explicit model identity (e.g., research-os reviewer profiles).

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": {
"question": {
"type": "string",
"minLength": 1,
"description": "The question to answer."
},
"source_paths": {
"description": "Files the answer must be grounded in. Nothing outside this list is allowed as a source."
},
"max_words": {
"description": "Target answer length in words (default 300).",
"type": "integer",
"minimum": 20,
"maximum": 1500
},
"per_file_max_chars": {
"description": "Chars to read per file (default 40k).",
"type": "integer",
"minimum": 1000,
"maximum": 200000
},
"model": {
"description": "Optional per-call model override. When provided, overrides the tool's tier-resolved model for this call. The tier's timeout (TIER_TIMEOUT_MS) still applies. On timeout, fallback uses the tier-resolved model, NOT the override. Use for receipt-backed orchestration that requires explicit model identity (e.g., research-os reviewer profiles).",
"type": "string",
"minLength": 1
}
},
"required": [
"question",
"source_paths"
]
}

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/research.ts · registration: src/index.ts


Back to the Tool Reference.