Skip to main content
Glama
calibre-mcp

calibre-mcp

by caelum29

Build semantic index

calibre_build_index
Idempotent

Build a searchable semantic index for Calibre books selected by ID or query, extracting, chunking, and embedding text. Re-run after adding books to keep search results current.

Instructions

Build the semantic index for specific books (select them with bookId, ids, or query; at least one is required; to index everything, pass a query that matches every book). A query selects ALL matching books (no 100-book cap); a call still working after ~45 s returns a "still running" status (not an error) while the build keeps committing in the background — re-run the same call to get its result; only one build runs per library at a time, and 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 enableFts=true to also turn on the Calibre full-text index for the library (needs writes enabled on this server; with writes off the semantic build still runs and the fts.status result field is write_disabled; already-enabled is a no-op; Calibre indexes in the background and the call does not wait). Set prune=true to also drop index entries for books that no longer exist in the library (removals/merges leave searchable orphans behind).

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "calibre_build_index"
  }
}

Input Schema

NameRequiredDescriptionDefault
idsNo
forceNo
pruneNo
queryNo
bookIdNo
libraryNo
enableFtsNo
keywordOnlyNo

Output Schema

NameRequiredDescriptionDefault
ftsNo
chunksNo
figuresNo
failuresNo
booksDoneNo
elapsedMsNo
indexedIdsNo
removedIdsNo
bookDetailsNo
keywordOnlyNo
prunedBooksNo
booksIndexedNo
booksSkippedNo
prunedChunksNo
runningBuildNo
stillRunningNo
prunedFiguresNo
booksPreservedNo
booksRefreshedNo
booksRequestedNo
semanticReasonNo
semanticAvailableNoIs the embedding model usable on this server? true even for a requested keywordOnly build when the model is present (vector & hybrid then need a rebuild without keywordOnly); false only when it is missing or failed to load. The build mode is keywordOnly.
backgroundBuildFailedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.13.0
    • addedOutput schema / $schema
      Added value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / properties / fts
      Added value: +{
      +  "additionalProperties": false,
      +  "properties": {
      +    "detail": {
      +      "type": "string"
      +    },
      +    "progress": {
      +      "type": "string"
      +    },
      +    "status": {
      +      "enum": [
      +        "write_disabled",
      +        "enabled",
      +        "already_enabled",
      +        "failed"
      +      ],
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "status"
      +  ],
      +  "type": "object"
      +}
    • addedOutput schema / properties / removedIds
      Added value: +{
      +  "items": {
      +    "type": "number"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / semanticAvailable / description
      Added value: +"Is the embedding model usable on this server? true even for a requested keywordOnly build when the model is present (vector & hybrid then need a rebuild without keywordOnly); false only when it is missing or failed to load. The build mode is keywordOnly."
  2. Changed6 schema fields changedv0.12.0
    • addedOutput schema / properties / backgroundBuildFailed
      Added value: +{
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / booksDone
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / booksRefreshed
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / indexedIds
      Added value: +{
      +  "items": {
      +    "type": "number"
      +  },
      +  "type": "array"
      +}
    • addedOutput schema / properties / runningBuild
      Added value: +{
      +  "enum": [
      +    "this",
      +    "other"
      +  ],
      +  "type": "string"
      +}
    • addedOutput schema / properties / stillRunning
      Added value: +{
      +  "type": "boolean"
      +}
  3. Changed1 schema field changedv0.10.0
    • addedOutput schema / properties / booksPreserved
      Added value: +{
      +  "type": "number"
      +}
  4. First observedv0.7.2

TDQS

A4.9/5.0
Behavior5/5

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

Goes well beyond the annotations: the ~45 s "still running" status is not an error, background commits continue, concurrent builds are serialized to one per library, and automatic keyword-only fallback when no embedding model exists. It also discloses that enableFts requires writes to be enabled and surfaces write_disabled in the fts.status field, which the annotations alone never convey.

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 purpose and selection rules, and every clause carries operational information. However it is delivered as one long semicolon-and-parenthesis chain, so timeout, force, FTS, and prune behaviors would be far more scannable as separated sentences or bullets.

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

Completeness5/5

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

For an 8-parameter mutation tool with background work and no schema descriptions, this covers selection, idempotency, timeout semantics, concurrency, permission-dependent behavior, and orphan cleanup. An output schema exists, so omitting return-value detail is appropriate; usefully, one result field (fts.status) is still called out.

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

Parameters5/5

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

Schema description coverage is 0%, so the description carries the full burden and does: it explains bookId/ids/query selection semantics (query matches ALL, no 100-book cap), force, keywordOnly, enableFts, and prune. The only weak spot is the library parameter, which is referenced only obliquely via "one build runs per library at a time."

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?

Opens with a specific verb+resource ("Build the semantic index") and immediately narrows scope ("for specific books"). The mechanism ("Extracts, chunks, and embeds each book") makes it unmistakable that this is an indexing job rather than a search tool like calibre_semantic_search.

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

Usage Guidelines5/5

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

Explicitly states the selection requirement ("at least one is required"), gives the match-all-query idiom for indexing everything, and prescribes re-run behavior after adding books plus force for unchanged ones. It also names the when-not path (up-to-date books are skipped) and the keyword-only alternative via keywordOnly=true.

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