query_documents
Search indexed local documents using hybrid semantic and keyword matching; get ranked passages, sources, and parent sections for grounded answers.
Instructions
Hybrid search: semantic similarity plus a keyword boost for exact terms.
Returns results — ranked chunks with text, source, title,
chunkIndex, score and parentId — sources, the distinct
sources in rank order each with a hits count and a
displayPath to show the user (source stays absolute and is
what the other tools take), and parents, a map from parentId
to section text. Use sources to answer "which documents
cover this topic" without inspecting individual chunks.
A sources row carries lookAlikes when other indexed documents
overlap it by 0.5 or more: up to 3, most first, each with source,
displayPath, overlap (0..1, the estimated Jaccard similarity of
the two texts' five-word runs: runs in common over runs in either,
so a short text wholly inside a much longer one scores low) and
date when known. They
come from the whole index, outside scope and filters too. Overlap is
measured text, not a verdict on which one is current: an older
version or a sibling filled in from one template can hold other
figures, so check both before quoting one.
Results are ranked and stop at topK without saying what they left out. For every document that mentions a term, how many do, or whether something is mentioned at all, use find_mentions.
text is the passage that matched and that score describes.
parentId names the section it sits in — a transcript time
window, a heading section, a slide, a table. Look it up in
parents to read the whole section when the match alone is too
small to act on. A chunk indexed before parent sections existed
has parentId null and no entry; re-sync to fill it in.
A hit from a PDF file also carries pages, the page or pages of
the file its text came from ("12" or "12-13"); a hit from any other
source, or whose page is not certain, has none.
topK must be at least 1 and is capped at 100; a larger value is silently clamped to the cap rather than rejected.
When nothing matches because nothing could — an empty index, or a
scope no indexed document is under — notice says which.
Cite what you take, so the user can verify it, in whatever
language you answer: end with a Sources list, one line per
document you actually used, each line just that document's
displayPath copied verbatim — no [n] markers, nothing else
on the line. Plain text, never a markdown link or file://.
labels ({facet: value or [values]}) and dateFrom/dateTo
(YYYY-MM-DD, inclusive) narrow the search to labelled documents when
the corpus has a classify.toml; status lists its facets and values
under labels — map an approximate name to a value from there.
filterCounts then says how many documents in scope were left out
only for having no label or no date; each sources row carries its
labels and date.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>"
},
"name": "query_documents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| topK | No | ||
| query | Yes | ||
| scope | No | ||
| dateTo | No | ||
| labels | No | ||
| dateFrom | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||