Skip to main content
Glama
ispyridis

Calibre RAG MCP Server

by ispyridis

fetch

Extract specific content from ebooks using epub URLs to retrieve targeted book passages for research or reference purposes.

Instructions

Fetch specific content from a book using epub:// URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesepub:// URL from search results

Implementation Reference

  • server.js:988-1001 (registration)
    Registration of the 'fetch' tool in the tools list, including name, description, and input schema.
    {
        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']
        }
    },
  • Input schema for the 'fetch' tool defining the expected 'url' parameter.
    inputSchema: {
        type: 'object',
        properties: {
            url: {
                type: 'string',
                description: 'epub:// URL from search results'
            }
        },
        required: ['url']
    }
  • Handler for the 'fetch' tool call; currently a placeholder that returns an error indicating implementation is pending.
    case 'fetch':
        // Implementation would be similar to original
        this.sendError(id, -32601, 'Fetch tool implementation pending');
        break;
  • Helper function to create epub:// URLs used by the 'fetch' tool.
    createEpubUrl(author, title, id, startLine = '', endLine = '') {
        const encAuthor = encodeURIComponent(author);
        const encTitle = encodeURIComponent(title);
        
        let url = `epub://${encAuthor}/${encTitle}@${id}`;
        if (startLine && endLine) {
            url += `#${startLine}:${endLine}`;
        }
        return url;
    }
  • Helper function to parse epub:// URLs for the 'fetch' tool implementation.
    parseEpubUrl(url) {
        url = url.replace(/^epub:\/\//, '');
        
        const idMatch = url.match(/@(\d+)/);
        if (!idMatch) {
            throw new Error('Invalid epub URL format');
        }
        const bookId = idMatch[1];
        
        let startLine = '';
        let endLine = '';
        const rangeMatch = url.match(/#(\d+):(\d+)$/);
        if (rangeMatch) {
            startLine = rangeMatch[1];
            endLine = rangeMatch[2];
        }
        
        return { bookId, startLine, endLine };
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states the tool fetches content but doesn't disclose behavioral traits such as whether it's read-only or mutative, what happens with invalid URLs, rate limits, or authentication needs. This is inadequate for a tool with zero annotation coverage.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the purpose and key constraint ('epub:// URL'). There's no wasted text, making it appropriately sized and well-structured for quick understanding.

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 tool's complexity (fetching content with a single parameter), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what 'content' is returned (e.g., text, metadata), error handling, or other behavioral aspects needed for effective 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 schema description coverage is 100%, with the parameter 'url' fully documented in the schema. The description adds minimal value by specifying 'epub:// URL from search results', which hints at the source but doesn't provide additional syntax or format details beyond the schema. Baseline 3 is appropriate when the schema does the heavy lifting.

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 action ('fetch') and resource ('specific content from a book'), and specifies the required input format ('using epub:// URL'). However, it doesn't explicitly differentiate from the sibling 'search' tool, which likely returns URLs rather than content. This makes it clear but not fully sibling-distinctive.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention the sibling 'search' tool, prerequisites like needing a URL from search results, or any exclusions. This leaves the agent with minimal context for tool selection.

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