note_delete
Delete a note by its ID to remove outdated or incorrect entries from your project tracker. Keep your data clean and organized.
Instructions
Delete a note by ID.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Note ID |
Implementation Reference
- src/tools/notes.ts:180-191 (handler)The handler function that executes the note_delete tool logic. It gets the database, looks up the note by ID (throwing if not found), deletes the note, logs the activity, and returns the deleted note's id, title, and a deleted flag.
function handleNoteDelete(args: Record<string, unknown>) { const db = getDb(); const id = args.id as number; const note = db.prepare('SELECT * FROM notes WHERE id = ?').get(id) as Record<string, unknown> | undefined; if (!note) throw new Error(`Note ${id} not found`); db.prepare('DELETE FROM notes WHERE id = ?').run(id); logActivity(db, 'note', id, 'deleted', null, null, null, `Note '${note.title}' deleted`); return { id, title: note.title, deleted: true }; } - src/tools/notes.ts:70-81 (schema)The schema/input validation definition for the note_delete tool. It defines the tool name, description, annotations (destructiveHint: true), and an inputSchema requiring an integer 'id' field.
{ name: 'note_delete', description: 'Delete a note by ID.', annotations: { title: 'Delete Note', readOnlyHint: false, destructiveHint: true, idempotentHint: true, openWorldHint: false }, inputSchema: { type: 'object', properties: { id: { type: 'integer', description: 'Note ID' }, }, required: ['id'], }, }, - src/tools/notes.ts:192-198 (registration)The handler registration mapping the string 'note_delete' to the handleNoteDelete function, exported as part of the handlers record.
export const handlers: Record<string, ToolHandler> = { note_save: handleNoteSave, note_list: handleNoteList, note_search: handleNoteSearch, note_delete: handleNoteDelete, }; - src/index.ts:37-49 (registration)Top-level registration where noteHandlers (including note_delete) are spread into the ALL_HANDLERS record, making it available for the CallToolRequestSchema handler.
const ALL_HANDLERS: Record<string, (args: Record<string, unknown>) => unknown> = { ...projectHandlers, ...epicHandlers, ...taskHandlers, ...subtaskHandlers, ...noteHandlers, ...commentHandlers, ...templateHandlers, ...dashboardHandlers, ...searchHandlers, ...activityHandlers, ...exportImportHandlers, };