get_note_by_id
Retrieve a specific note from NotePlan using its unique identifier to access content directly within Claude conversations.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the note to retrieve |
Implementation Reference
- src/index.ts:32-51 (registration)Registration of the 'get_note_by_id' MCP tool, including input schema (id: string) and inline handler that calls noteService.getNoteById and returns JSON-formatted note.server.tool( 'get_note_by_id', { id: z.string().describe('The ID of the note to retrieve'), }, async ({ id }) => { const note = noteService.getNoteById(id); if (!note) { throw new Error(`Note not found with id: ${id}`); } return { content: [ { type: 'text', text: JSON.stringify(note, null, 2), }, ], }; } );
- src/services/noteService.ts:211-214 (handler)Core handler logic for retrieving a note by its ID: loads all notes from cache/filesystem and finds the matching note.function getNoteById(id: string): Note | null { const notes = getAllNotes(); return notes.find(note => note.id === id) || null; }
- src/services/noteService.ts:9-19 (schema)TypeScript interface defining the Note object structure used in tool responses.interface Note { id: string; title: string; content: string; created: string; modified: string; folder: string; filePath?: string; filename?: string; type?: string; }