list_directory
Retrieve and display the contents of a directory within your MCP Notes, including files and subdirectories, by specifying a relative path. Ideal for organizing and browsing your knowledge base.
Instructions
List the contents of a directory in your notes. Shows all files and directories with clear labels. Specify path relative to your notes directory (e.g., 'Log' or 'Rollups').
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | No | Directory path relative to notes directory (defaults to root notes directory if not provided) |
Implementation Reference
- src/tools/index.ts:357-358 (registration)The list_directory tool is registered here in the handleToolCall switch statement. It delegates execution to the handleListDirectory function imported from filesystem.js.case "list_directory": return await handleListDirectory(notesPath, args);
- src/tools/index.ts:88-206 (schema)The schema for list_directory is provided via the spread of filesystemTools returned by getFilesystemToolDefinitions(), which includes the input schema for list_directory.export function getToolDefinitions(): ToolDefinition[] { const filesystemTools = getFilesystemToolDefinitions(); return [ { name: "log", description: "Create or update today's daily log file. Optionally add notes to the log.", inputSchema: { type: "object", properties: { notes: { type: "string" }, tags: { type: "array", items: { type: "string" }, description: `${TAG_VALIDATION_DESCRIPTION} Analyze the note's content and identify key themes, concepts, and categories that connect it to other notes. Consider: - Core topics and themes present in the note - Broader domains or areas of knowledge - Types of information (decisions, ideas, research, etc.) - Projects or contexts that might want to reference this later Do not force tags - only add ones that naturally emerge from the content and would help build meaningful connections between notes.` } }, required: ["notes", "tags"] } }, { name: "evaluateInsight", description: ` Evaluate the long-term value and significance of an insight or thought based on the following criteria: 1. Actionability (1-10): Can this be applied to future work? Is there any information that can be used to apply this thought to future work in different contexts? Is the problem it solves clear? 2. Longevity (1-10): Will this be relevant months or years from now? 3. Findability (1-10): Would this be hard to rediscover if forgotten? 4. Future Reference Value (1-10): How likely are you to need this again? Insights to ignore: 1. Trivial syntax details 2. Redundant information `, inputSchema: { type: "object", properties: { thought: { type: "string" }, evaluationStep: { type: "number" }, totalSteps: { type: "number" }, nextStepNeeded: { type: "boolean" }, actionability: { type: "number" }, longevity: { type: "number" }, findability: { type: "number" }, futureReferenceValue: { type: "number" } }, required: ["thought", "evaluationStep", "totalSteps", "nextStepNeeded", "actionability", "longevity", "findability", "futureReferenceValue"] }, }, { name: "rollup", description: ` Synthesize my daily note to create an organized rollup of the most important notes with clear categories, connections, and action items. Optionally specify a date (YYYY-MM-DD). Only include notes that actually add long-term value. If you are unsure, call the /evaluateInsight tool to evaluate the long-term value of the thought. If you do not have enough information, stop and ask the user for more information. It is better to not log anything than log something that is not useful. `, inputSchema: { type: "object", properties: { date: { type: "string" }, accomplishments: { type: "array", items: { type: "string" }, description: "A list of accomplishments. Each accomplishment should be a short description of the work done in the day so that it can answer the question 'what did you do all day?'", }, insights: { type: "array", items: { type: "string" }, description: "A list of insights. Each insight should be a long-term storage. Things like new knowledge gained. Do not force insights - only add ones that naturally emerge from the content and would help build meaningful connections between notes.", }, todos: { type: "array", items: { type: "string" }, description: "A list of todos. Each todo should be a short description of the task to be done. A todo should be actionable.", }, }, required: ["accomplishments", "insights"] }, }, { name: "write_note", description: "Create a new note or overwrite an existing note with content. " + "Path should be relative to your notes directory. " + "Optionally include tags that will be merged with any existing tags in the note.", inputSchema: { type: "object", properties: { path: { type: "string", description: "Path where the note should be saved, relative to notes directory" }, content: { type: "string", description: "Content to write to the note" }, tags: { type: "array", items: { type: "string" }, description: `${TAG_VALIDATION_DESCRIPTION} Tags to add to the note's frontmatter. Will be merged with existing tags if present.` } }, required: ["path", "content"] }, }, ...filesystemTools ]; }
- src/tools/index.ts:8-17 (helper)Import of the handleListDirectory handler function and getFilesystemToolDefinitions which provides the schema and other filesystem helpers.import { ensureDirectory, initializeNotesDirectory, handleSearchFiles, handleReadNote, handleReadMultipleNotes, handleListDirectory, handleCreateDirectory, getFilesystemToolDefinitions } from './filesystem.js';