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 };
    }
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 of behavioral disclosure. It states the tool fetches content but doesn't describe what 'fetch' entails operationally—e.g., whether it retrieves metadata, full text, or specific sections; whether it requires authentication; or what the output format might be. This leaves significant gaps in understanding the tool's behavior.

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 directly states the tool's purpose without unnecessary words. It is appropriately sized and front-loaded, making it easy to understand at a glance. Every part of the sentence contributes essential information.

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 fetching content (which could involve various outputs like text, metadata, or errors), the lack of annotations and output schema means the description is incomplete. It doesn't explain what is returned, potential errors, or behavioral nuances. For a tool with no structured support, the description should provide more context to be fully helpful.

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 as 'epub:// URL from search results'. The description adds no additional meaning beyond this, such as URL format examples or constraints. With high schema coverage, the baseline score of 3 is appropriate as the description doesn't enhance parameter understanding.

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: 'Fetch specific content from a book using epub:// URL'. It specifies the action (fetch), resource (content from a book), and input mechanism (epub:// URL). However, it doesn't explicitly distinguish this tool from sibling tools like 'search' or 'search_project_context', which might also retrieve book content in different ways.

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 minimal guidance on when to use this tool. It implies usage when you have an 'epub:// URL from search results', but doesn't specify when to choose this over alternatives like 'search' or 'search_project_context', nor does it mention prerequisites or exclusions. No explicit when/when-not instructions are provided.

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-rag-mcp-nodejs'

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