Skip to main content
Glama
ispyridis

Calibre MCP Server

by ispyridis

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);
        }
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the two search modes but doesn't describe important behavioral traits like whether this is a read-only operation, performance characteristics, error handling, or what happens when no results are found. For a search tool with zero annotation coverage, this leaves significant gaps.

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?

The description is appropriately concise with two sentences that efficiently convey the core functionality. It's front-loaded with the main purpose and follows with search mode details. Every sentence serves a purpose without unnecessary elaboration.

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

Completeness2/5

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

Given the complexity of a search tool with 3 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what results look like, how they're formatted, whether pagination is supported beyond the limit parameter, or what authentication/rate limits apply. The description should provide more context for effective tool use.

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

Parameters3/5

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

The description adds minimal value beyond the input schema, which has 100% coverage. It mentions 'full-text content search (default) and metadata search using field syntax' which provides some context for the query parameter, but doesn't add meaningful semantics beyond what's already documented in the schema descriptions for each parameter.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Search the Calibre ebook library' with specific capabilities (full-text content search and metadata search). It distinguishes the search function from the sibling 'fetch' tool by specifying search operations rather than retrieval. However, it doesn't explicitly differentiate from 'fetch' in terms of when to use each.

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

Usage Guidelines3/5

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

The description provides some usage context by mentioning 'default' full-text search and metadata search with field syntax, but it doesn't explicitly state when to use this tool versus the 'fetch' sibling or provide clear when/when-not guidance. The usage is implied rather than explicitly defined.

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

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