Skip to main content
Glama
caelum29

calibre-mcp

by caelum29

Build semantic index

calibre_build_index
Idempotent

Build a semantic index for Calibre books by ID, list, or query so they become searchable. Extracts, chunks, and embeds text; re-run to resume or add books.

Instructions

Build the semantic index for specific books (required: bookId, ids, or query — full-library indexing is deferred). A query selects ALL matching books (no 100-book cap); large selections run long and may outlive the client timeout — re-run the same call to resume, since up-to-date books are skipped. Extracts, chunks, and embeds each book. Set keywordOnly=true (or when the embedding model is absent, it happens automatically) to build a keyword-only index that powers mode:"keyword" search with zero ML dependencies. Re-run after adding books; use force to re-index unchanged ones. Set prune=true to also drop index entries for books that no longer exist in the library (removals/merges leave searchable orphans behind).

Input Schema

NameRequiredDescriptionDefault
idsNo
forceNo
pruneNo
queryNo
bookIdNo
libraryNo
enableFtsNo
keywordOnlyNo

Output Schema

NameRequiredDescriptionDefault
chunksNo
figuresNo
failuresNo
elapsedMsNo
bookDetailsNo
keywordOnlyNo
prunedBooksNo
booksIndexedNo
booksSkippedNo
prunedChunksNo
prunedFiguresNo
booksPreservedNo
booksRequestedNo
semanticReasonNo
semanticAvailableNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.10.0
    • addedOutput schema / properties / booksPreserved
      Added value: +{
      +  "type": "number"
      +}
  2. First observedv0.7.2

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the annotations: discloses that large selections may outlive client timeouts and that re-running resumes because up-to-date books are skipped, explains the automatic fallback to keyword-only indexing when the embedding model is absent, and warns that prune drops orphaned index entries. This is exactly the operational context the idempotentHint alone doesn't convey and is consistent with readOnlyHint=false.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the required-scope constraint, then ordered by operational importance (long-running/resume, build variants, force, prune). Dense but every sentence carries behavioral information; only minor tightening would improve it.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values needn't be described, and the long-running/resume and fallback semantics are well covered for a mutating indexing job. The remaining gap is the two undocumented parameters (enableFts, library), which an agent cannot reason about from either schema or description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage the description carries the full load, and it explains five of eight parameters meaningfully (bookId/ids/query, keywordOnly, force, prune) including their side effects. enableFts and library are left completely unexplained, which keeps it from a 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Build the semantic index') and immediately scopes it ('for specific books'), which separates it from the sibling search/report tools. The added note that full-library indexing is deferred further sharpens the boundary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives clear when-to-use context: scope selection via bookId/ids/query, re-run after adding books, and force for re-indexing unchanged books. It does not explicitly name which sibling consumes the index (calibre_semantic_search) or when to prefer a keyword-only build over a full one beyond the embedding-model case.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.