Skip to main content
Glama

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

NameRequiredDescriptionDefault

No arguments

Input Schema (JSON Schema)

{ "properties": {}, "type": "object" }

Implementation Reference

  • 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), }, ], }; }
  • 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();
  • 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}`); } }

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/santis84/mcp-rag'

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