get_note_by_id
Retrieve a specific note by its ID from the NotePlan MCP Server, enabling direct access to note content within Claude Desktop for streamlined workflow integration.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the note to retrieve |
Implementation Reference
- src/index.ts:37-50 (handler)The async handler function for the 'get_note_by_id' MCP tool. It retrieves the note using noteService.getNoteById, throws error if not found, and returns the note as formatted JSON text content.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/index.ts:34-36 (schema)Zod input schema for the tool, defining the required 'id' string parameter.{ id: z.string().describe('The ID of the note to retrieve'), },
- src/index.ts:32-33 (registration)Registration of the 'get_note_by_id' tool on the MCP server.server.tool( 'get_note_by_id',
- src/services/noteService.ts:211-214 (helper)Helper function getNoteById that searches the cached notes list for a note matching the given ID.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 structure of Note objects used and returned by the tool.interface Note { id: string; title: string; content: string; created: string; modified: string; folder: string; filePath?: string; filename?: string; type?: string; }