BM25 search
bm25_searchIndex inline or directory documents with Okapi BM25 and retrieve top-k results with scores, matched terms, and snippets for keyword search.
Instructions
Builds an Okapi BM25 index over documents passed inline and/or loaded from a directory inside the configured documentRoot, then returns the top-k documents with scores, matched terms, and snippets. Disk access is disabled unless documentRoot is configured.
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": "bm25_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| b | No | Length normalization (default 0.75) | |
| k1 | No | Term frequency saturation (default 1.2) | |
| topK | No | Results to return (default 5) | |
| query | Yes | Search query | |
| directory | No | Directory relative to documentRoot to load .txt/.md files from | |
| documents | No | Inline documents to index |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hits | Yes | ||
| query | Yes | ||
| skipped | Yes | ||
| documentCount | Yes | ||
| vocabularySize | Yes |