delete_notes
Remove specified notes from the Anki MCP server by providing an array of note IDs. Simplify note management and declutter your Anki database efficiently.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| noteIds | Yes | Array of note IDs to delete |
Implementation Reference
- src/tools/notes.ts:136-159 (registration)The complete registration of the 'delete_notes' MCP tool, including schema validation (noteIds: array of numbers) and inline handler that calls ankiClient.note.deleteNotes and returns a success message.server.tool( 'delete_notes', { noteIds: z.array(z.number()).describe('Array of note IDs to delete'), }, async ({ noteIds }) => { try { await ankiClient.note.deleteNotes({ notes: noteIds }); return { content: [ { type: 'text', text: `Successfully deleted ${noteIds.length} notes: [${noteIds.join(', ')}]`, }, ], }; } catch (error) { throw new Error( `Failed to delete notes: ${error instanceof Error ? error.message : String(error)}` ); } } );
- src/tools/notes.ts:141-158 (handler)The handler function for delete_notes tool: takes noteIds, deletes them via ankiClient.note.deleteNotes, returns formatted success text or throws error.async ({ noteIds }) => { try { await ankiClient.note.deleteNotes({ notes: noteIds }); return { content: [ { type: 'text', text: `Successfully deleted ${noteIds.length} notes: [${noteIds.join(', ')}]`, }, ], }; } catch (error) { throw new Error( `Failed to delete notes: ${error instanceof Error ? error.message : String(error)}` ); } }
- src/tools/notes.ts:138-140 (schema)Input schema for delete_notes tool using Zod: requires noteIds as array of numbers.{ noteIds: z.array(z.number()).describe('Array of note IDs to delete'), },