list_files
List all files in a project directory to view the structure and contents of your codebase. Specify the project path to retrieve the file listing.
Instructions
List files in a project directory
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | Path to the project directory |
Implementation Reference
- server.js:232-256 (handler)The main implementation of listFiles method that reads a directory and returns a formatted list of files with icons distinguishing directories from filesasync listFiles(projectPath) { const fullPath = path.join(this.workingDir, projectPath); try { const files = await fs.readdir(fullPath, { withFileTypes: true }); const fileList = files.map(file => `${file.isDirectory() ? '๐' : '๐'} ${file.name}`).join('\n'); return { content: [ { type: "text", text: `Files in ${projectPath}:\n\n${fileList}` } ] }; } catch (error) { return { content: [ { type: "text", text: `Error listing files: ${error.message}` } ] }; } }
- server.js:79-92 (registration)Tool schema registration defining the list_files tool name, description, and input parameters (project_path){ name: "list_files", description: "List files in a project directory", inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to the project directory" } }, required: ["project_path"] } },
- server.js:141-142 (registration)Handler routing that maps the 'list_files' tool name to the listFiles method executioncase 'list_files': return await this.listFiles(args.project_path);