list_files
Retrieve a complete list of all files stored in the RAG system for document management and semantic search operations.
Instructions
List all files in the RAG system
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/index.ts:374-384 (handler)The primary handler function for the 'list_files' MCP tool. It calls RAGService.listFiles() and returns the result as formatted JSON in the tool response content.private async handleListFiles() { const files = await this.ragService.listFiles(); return { content: [ { type: 'text', text: JSON.stringify(files, null, 2), }, ], }; }
- src/index.ts:86-93 (schema)Tool schema definition provided in ListTools response, including name, description, and empty input schema (no parameters required).{ name: 'list_files', description: 'List all files in the RAG system', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:242-243 (registration)Registration of the 'list_files' tool handler in the CallToolRequestSchema switch statement.case 'list_files': return await this.handleListFiles();
- src/services/ragService.ts:107-117 (helper)Helper method in RAGService that provides the file listing logic called by the main handler (currently a stub returning empty array).async listFiles(): Promise<FileInfo[]> { try { // This would need to be implemented to track files in the database // For now, return empty array logger.info('Listing files in RAG system'); return []; } catch (error) { logger.error(`Error listing files: ${error}`); throw new Error(`Failed to list files: ${error}`); } }