Skip to main content
Glama

search

Search your Calibre ebook library using natural language queries or metadata field syntax to find books by content, author, or title.

Instructions

Search the Calibre ebook library. Supports both full-text content search (default) and metadata search using field syntax.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query. For full-text: use natural language. For metadata: use field syntax (author:Name, title:"Title").
limitNoMaximum number of results (default: 50)
fuzzy_fallbackNoAlternative search terms if exact query fails

Implementation Reference

  • The handler for the 'search' tool in handleToolsCall. It extracts parameters, calls searchUnified, determines search type, formats response, and sends it.
    case 'search': const query = args.query; const limit = args.limit || 50; if (!query) { this.sendError(id, -32602, 'Missing required parameter: query'); return; } const results = await this.searchUnified(query, limit); // Determine search type const parsed = this.parseHybridQuery(query); let searchType; if (parsed.hasMetadata && parsed.hasContent) { searchType = 'hybrid'; } else if (parsed.hasMetadata) { searchType = 'metadata'; } else { searchType = 'fulltext'; } const mcpResult = this.formatDualResponse(results, query, searchType); this.sendSuccess(id, mcpResult); break;
  • The schema definition for the 'search' tool, including name, description, and inputSchema, provided in the tools/list response.
    { name: 'search', description: 'Search the Calibre ebook library. Supports both full-text content search (default) and metadata search using field syntax.', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query. For full-text: use natural language. For metadata: use field syntax (author:Name, title:"Title").' }, limit: { type: 'integer', description: 'Maximum number of results (default: 50)', default: 50 }, fuzzy_fallback: { type: 'string', description: 'Alternative search terms if exact query fails' } }, required: ['query'] } },
  • server.js:522-564 (registration)
    The handleToolsList method registers and returns the list of available tools, including the 'search' tool.
    handleToolsList(id) { const tools = [ { name: 'search', description: 'Search the Calibre ebook library. Supports both full-text content search (default) and metadata search using field syntax.', inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search query. For full-text: use natural language. For metadata: use field syntax (author:Name, title:"Title").' }, limit: { type: 'integer', description: 'Maximum number of results (default: 50)', default: 50 }, fuzzy_fallback: { type: 'string', description: 'Alternative search terms if exact query fails' } }, required: ['query'] } }, { name: 'fetch', description: 'Fetch specific content from a book using epub:// URL', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'epub:// URL from search results' } }, required: ['url'] } } ]; this.sendSuccess(id, { tools: tools }); }
  • Core helper method searchUnified that dispatches to metadata or full-text search based on query parsing.
    async searchUnified(query, limit = 50) { const parsed = this.parseHybridQuery(query); if (parsed.hasMetadata && parsed.hasContent) { // Hybrid search - not implemented in this version this.log('Hybrid search requested, falling back to metadata search'); return await this.searchBooksMetadata(query, limit); } else if (parsed.hasMetadata) { this.log(`Using metadata search for: ${query}`); return await this.searchBooksMetadata(query, limit); } else { this.log(`Using full-text search for: ${query}`); return await this.searchBooksFulltext(query, limit); } }
Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ispyridis/calibre-mcp-nodejs'

If you have feedback or need assistance with the MCP directory API, please join our Discord server