Semantic search
calibre_semantic_searchSearch a Calibre library or one book by meaning with semantic, hybrid, or keyword matching, and target figure captions for diagrams. Requires an index built via calibre_build_index.
Instructions
Meaning-based search for query over the local index. scope=library ranks books; scope=book (needs bookId) ranks passages within one book. target=figures searches figure captions instead of text — use when the user asks for a diagram/chart/schema; hits point at calibre_get_figures for the pixels. mode=hybrid (default) fuses semantic + keyword matches; mode=vector is semantic-only; mode=keyword is exact keyword/FTS (no model at query time). All modes need an index built by calibre_build_index. filter accepts a bundle name to scope library searches (list bundles via calibre_manage_bundles). Model inference is serialized: prefer one call at a time — parallel calls queue, and past a few the extras skip the rerank.
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": "calibre_semantic_search"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | hybrid | |
| topK | No | ||
| query | Yes | ||
| scope | No | library | |
| bookId | No | ||
| filter | No | ||
| target | No | text | |
| library | No | ||
| include_excluded | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | ||
| note | No | ||
| count | No | ||
| scope | No | ||
| bookId | No | ||
| filter | No | ||
| target | No | ||
| bookIds | No | ||
| dropped | No | Only at CALIBRE_MCP_LOG_LEVEL=debug, when a text keyword half ran: query terms the keyword MATCH left out: stems in query order — repeated ones (duplicate) and those in more than half of the library's chunks (too-common) — then any identifier (e.g. `is-a`) whose every stem was too common. Absent when the library has no term statistics. | |
| figures | No | ||
| results | No | ||
| timings | No | ||
| maxScore | No | ||
| passages | No | ||
| reranked | No | ||
| maxRerank | No | ||
| paramNotes | No | A line per limit param that fell back to its default or max instead of the value sent | |
| indexVersion | No | ||
| lowConfidence | No | ||
| semanticReason | No | ||
| exclusionsApplied | No | ||
| exclusionsRemoved | No | ||
| semanticAvailable | No | Can vector & hybrid ranking run on this library's index? false when the index is keyword-only (no embeddings); semanticReason and the note say whether a rebuild or a model install is the fix. |