list_projects
Retrieve all available RAG projects to organize and access your Calibre ebook library for semantic search and contextual conversations.
Instructions
List all available RAG projects
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.js:1113-1135 (handler)Handler for the 'list_projects' tool. Lists all loaded RAG projects from the this.projects Map, formats project details including name, description, book count, chunk count, creation and update times, and sends a formatted MCP response.case 'list_projects': const projectList = Array.from(this.projects.entries()).map(([name, config]) => ({ name, description: config.description, book_count: config.books.length, chunk_count: config.chunk_count, created_at: config.created_at, last_updated: config.last_updated })); this.sendSuccess(id, { content: [{ type: 'text', text: `Available RAG Projects (${projectList.length}):\n\n` + projectList.map(p => `• **${p.name}**: ${p.description}\n` + ` Books: ${p.book_count}, Chunks: ${p.chunk_count}\n` + ` Created: ${p.created_at}\n` ).join('\n') }], projects: projectList }); break;
- server.js:1004-1011 (schema)Schema definition for the 'list_projects' tool as returned in tools/list response. No input parameters required.name: 'list_projects', description: 'List all available RAG projects', inputSchema: { type: 'object', properties: {}, required: [] } },
- server.js:962-1089 (registration)Registration of the 'list_projects' tool via the tools/list MCP method handler, which includes it in the list of available tools.handleToolsList(id) { const tools = [ // Original Calibre 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'] } }, // New RAG tools { name: 'list_projects', description: 'List all available RAG projects', inputSchema: { type: 'object', properties: {}, required: [] } }, { 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'] } }, { name: 'add_books_to_project', description: 'Add books to a RAG project for vectorization and context search', inputSchema: { type: 'object', properties: { project_name: { type: 'string', description: 'Name of the project' }, book_ids: { type: 'array', items: { type: 'integer' }, description: 'Array of book IDs to add to the project' } }, required: ['project_name', 'book_ids'] } }, { name: 'search_project_context', description: 'Search for relevant context chunks within a RAG project using vector similarity', inputSchema: { type: 'object', properties: { project_name: { type: 'string', description: 'Name of the project to search' }, query: { type: 'string', description: 'Query to find relevant context' }, limit: { type: 'integer', description: 'Maximum number of context chunks to return (default: 5)', default: 5 } }, required: ['project_name', 'query'] } }, { name: 'get_project_info', description: 'Get detailed information about a specific RAG project', inputSchema: { type: 'object', properties: { project_name: { type: 'string', description: 'Name of the project' } }, required: ['project_name'] } } ]; this.sendSuccess(id, { tools: tools }); }
- server.js:545-570 (helper)Helper method that loads all RAG projects from the projects directory into the this.projects Map, which is used by the list_projects handler.loadProjects() { try { const projectDirs = fs.readdirSync(CONFIG.RAG.PROJECTS_DIR) .filter(dir => { const fullPath = path.join(CONFIG.RAG.PROJECTS_DIR, dir); return fs.statSync(fullPath).isDirectory(); }); for (const projectDir of projectDirs) { const configPath = path.join(CONFIG.RAG.PROJECTS_DIR, projectDir, 'project.json'); if (fs.existsSync(configPath)) { try { const config = JSON.parse(fs.readFileSync(configPath, 'utf8')); this.projects.set(projectDir, config); this.log(`Loaded project: ${projectDir}`); } catch (error) { this.log(`Failed to load project ${projectDir}: ${error.message}`); } } } this.log(`Loaded ${this.projects.size} projects`); } catch (error) { this.log(`Failed to load projects: ${error.message}`); } }