read_note
Access the full contents of a note file in your notes directory by specifying its relative path. Enables direct retrieval and review of stored information within your personal knowledge system.
Instructions
Read the complete contents of a note file from your notes directory. Specify the path relative to your notes directory (e.g., 'Log/2023-01-01.md'). Returns the full text content of the note file.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The path to the note file, relative to your notes directory |
Implementation Reference
- src/tools/filesystem.ts:212-243 (handler)Core handler function for the 'read_note' tool. Validates input, checks path security, reads the file using fs.readFile, and returns the content or error.export async function handleReadNote(notesPath: string, args: ReadNoteArgs): Promise<ToolCallResult> { try { // Validate path is provided if (!args.path) { throw new Error("'path' parameter is required"); } const filePath = path.join(notesPath, args.path); // Ensure the path is within allowed directory if (!filePath.startsWith(notesPath)) { throw new Error("Access denied - path outside notes directory"); } try { const content = await fs.readFile(filePath, 'utf-8'); return { content: [{ type: "text", text: content }] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); throw new Error(`Error reading file: ${errorMessage}`); } } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [{ type: "text", text: `Error reading note: ${errorMessage}` }], isError: true }; } }
- src/tools/filesystem.ts:27-29 (schema)Type definition for the input arguments of the read_note tool, requiring a 'path' string.interface ReadNoteArgs { path: string; }
- src/tools/filesystem.ts:68-83 (registration)Tool registration in getFilesystemToolDefinitions(): defines name, description, and input schema for 'read_note'.{ name: "read_note", description: "Read the complete contents of a note file from your notes directory. " + "Specify the path relative to your notes directory (e.g., 'Log/2023-01-01.md'). " + "Returns the full text content of the note file.", inputSchema: { type: "object", properties: { path: { type: "string", description: "The path to the note file, relative to your notes directory" } }, required: ["path"] }, },
- src/tools/index.ts:351-352 (registration)In the main handleToolCall switch statement, dispatches 'read_note' calls to the handleReadNote function.case "read_note": return await handleReadNote(notesPath, args);
- src/tools/index.ts:204-204 (registration)Includes filesystem tools (containing read_note definition) in the main getToolDefinitions() array via spread operator....filesystemTools