Skip to main content
Glama
ispyridis

Calibre RAG MCP Server

by ispyridis

create_project

Initialize a new vector-based RAG project for semantic book search and organization within your Calibre ebook library.

Instructions

Create a new RAG project for vector-based book search

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesProject name (alphanumeric and underscores only)
descriptionNoProject description

Implementation Reference

  • The core handler function that creates a new RAG project directory, initializes the chunks subdirectory, creates and saves project.json configuration, registers the project in memory, and returns the project config.
    async createProject(name, description = '', selectedBooks = []) {
        const projectPath = path.join(CONFIG.RAG.PROJECTS_DIR, name);
        
        if (fs.existsSync(projectPath)) {
            throw new Error(`Project '${name}' already exists`);
        }
        
        // Create project directory structure
        fs.mkdirSync(projectPath, { recursive: true });
        fs.mkdirSync(path.join(projectPath, 'chunks'), { recursive: true });
        
        const projectConfig = {
            name,
            description,
            created_at: new Date().toISOString(),
            books: selectedBooks,
            chunk_count: 0,
            vector_dimension: CONFIG.RAG.VECTOR_DIMENSION
        };
        
        // Save project configuration
        fs.writeFileSync(
            path.join(projectPath, 'project.json'),
            JSON.stringify(projectConfig, null, 2)
        );
        
        this.projects.set(name, projectConfig);
        this.log(`Created project: ${name}`);
        
        return projectConfig;
    }
  • MCP tool schema definition in the tools/list response, specifying the input schema with required 'name' and optional 'description' parameters.
        name: 'create_project',
        description: 'Create a new RAG project for vector-based book search',
        inputSchema: {
            type: 'object',
            properties: {
                name: {
                    type: 'string',
                    description: 'Project name (alphanumeric and underscores only)'
                },
                description: {
                    type: 'string',
                    description: 'Project description'
                }
            },
            required: ['name']
        }
    },
  • server.js:1137-1163 (registration)
    Registration and dispatching logic in the tools/call handler switch statement, including input validation and invocation of the createProject handler.
    case 'create_project':
        const projectName = args.name;
        const projectDesc = args.description || '';
        
        if (!projectName) {
            this.sendError(id, -32602, 'Missing required parameter: name');
            return;
        }
        
        if (!/^[a-zA-Z0-9_]+$/.test(projectName)) {
            this.sendError(id, -32602, 'Project name must contain only alphanumeric characters and underscores');
            return;
        }
        
        try {
            const newProject = await this.createProject(projectName, projectDesc);
            this.sendSuccess(id, {
                content: [{
                    type: 'text',
                    text: `Created project '${projectName}' successfully!\n\nNext steps:\n1. Search for books using the 'search' tool\n2. Add books to the project using 'add_books_to_project'\n3. Use 'search_project_context' for RAG queries`
                }],
                project: newProject
            });
        } catch (error) {
            this.sendError(id, -32603, error.message);
        }
        break;
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. While 'Create' implies a write/mutation operation, the description doesn't address important behavioral aspects like: what permissions are required, whether the creation is idempotent, what happens on duplicate names, what the response contains, or any rate limits. For a creation 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.

Conciseness5/5

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

The description is a single, efficient sentence that states the purpose without unnecessary words. It's appropriately sized for a simple creation tool and front-loads the essential information. Every word earns its place in this concise formulation.

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?

For a creation tool with no annotations and no output schema, the description is insufficient. It doesn't explain what a 'RAG project' entails, what 'vector-based book search' means operationally, what happens after creation, or what the agent should expect as a result. Given the complexity implied by 'RAG' and 'vector-based' terminology, more context would be helpful for proper tool selection and invocation.

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?

Schema description coverage is 100%, so the schema already fully documents both parameters (name with format constraints, description as optional). The description adds no additional parameter semantics beyond what's in the schema - it doesn't explain naming conventions, description best practices, or how these parameters affect the created project. Baseline 3 is appropriate when the schema does all the parameter documentation work.

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?

The description clearly states the specific action ('Create a new RAG project') and the resource type ('for vector-based book search'), distinguishing it from siblings like 'add_books_to_project' or 'list_projects'. It provides a concrete use case that helps differentiate this creation tool from other project-related operations.

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 like 'add_books_to_project' or 'get_project_info'. It doesn't mention prerequisites, dependencies, or whether this should be used before or after other operations. The agent must infer usage context from the tool name alone.

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