Retrieve
redctx_retrieveRank redacted passages by distinct query-word matches and BM25 relevance to return the best hits for topic or natural-language lookups across local project files.
Instructions
Rank redacted passages (up to 24 lines each) by how many distinct query words they contain, then by BM25 relevance, and return the best as --- @p_<id> <redacted path> lines S-E score=<n> --- headers followed by the passage text (for documents, lines of the extracted Markdown). Use it for topic or natural-language lookups when you don't know the exact wording; use redctx_search for an exact string or regex with context lines. Matching is case-insensitive on whole words over redacted text, with no stemming, embeddings or persistent index, so each call rescans the files. Only complete passages that fit max_chars are returned, with a [TRUNCATED: ...] note when more matched; the call fails when the scope holds more than 80 readable files or takes over 30 s, so pass paths or glob on larger roots.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| glob | No | Shell-style patterns matched against each file's root-relative path, for example `*.md` or `notes/*.txt`; a file is kept if it matches any pattern. `*` also matches `/`, so `*.md` matches at every depth. Default `[]` means no filter. Applied within `paths`. | |
| paths | No | Files or directories to include: root-relative paths or `@p_<id>` references from earlier output. Directories are walked recursively, skipping excluded, protected, symlinked and binary files. Default `[]` means the whole root. With `glob`, only files under these paths that also match a glob are used. | |
| query | Yes | Words describing what you are looking for, for example `retention policy exceptions`. Common stop words are ignored; 1 to 64 distinct searchable words are required. A placeholder counts as one word. | |
| max_chars | No | Character budget for the whole response; passages that would not fit completely are left out. Default 12000. | |
| max_results | No | Maximum passages to return. Default 8. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The tool output, identical to the text content block and already redacted: sensitive values appear as deterministic `[CATEGORY_<hex>]` placeholders (forms declared as aliases of one entity share its hex and add a form suffix, `[CATEGORY_<hex>.<form>]`) and files as `@p_<id>` references. When the result has `isError: true`, this is a fixed error message instead, such as a limit error or the notice that context access is blocked until the operator repairs the local redaction config. | |
| receipt | Yes | Redaction statistics for this call only; never contains original values. |