Delete Note
delete_noteDelete a note permanently from a MantisBT issue. Provide the issue ID and note ID to remove the note irreversibly.
Instructions
Permanently delete a note from a MantisBT issue. This action is irreversible — deleted notes cannot be recovered.
Returns a plain-text confirmation message on success. Returns an error if the note does not exist or the current user lacks permission to delete it (MantisBT enforces access control: users can typically only delete their own notes unless they have manager-level access or higher).
Prerequisites: obtain note_id from list_notes or from get_issue (notes[].id); obtain issue_id from the same source.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| issue_id | Yes | Numeric issue ID that owns the note — use get_issue or list_notes to identify this value | |
| note_id | Yes | Numeric note ID to delete — obtain from get_issue (notes[].id) or list_notes |
Implementation Reference
- src/tools/notes.ts:104-138 (handler)The delete_note tool handler: calls client.delete to permanently remove a note from a MantisBT issue, then returns a plain-text confirmation. Also handles errors.
// --------------------------------------------------------------------------- // delete_note // --------------------------------------------------------------------------- server.registerTool( 'delete_note', { title: 'Delete Note', description: `Permanently delete a note from a MantisBT issue. This action is irreversible — deleted notes cannot be recovered. Returns a plain-text confirmation message on success. Returns an error if the note does not exist or the current user lacks permission to delete it (MantisBT enforces access control: users can typically only delete their own notes unless they have manager-level access or higher). Prerequisites: obtain note_id from list_notes or from get_issue (notes[].id); obtain issue_id from the same source.`, inputSchema: z.object({ issue_id: z.coerce.number().int().positive().describe('Numeric issue ID that owns the note — use get_issue or list_notes to identify this value'), note_id: z.coerce.number().int().positive().describe('Numeric note ID to delete — obtain from get_issue (notes[].id) or list_notes'), }), annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, }, }, async ({ issue_id, note_id }) => { try { await client.delete<unknown>(`issues/${issue_id}/notes/${note_id}`); return { content: [{ type: 'text', text: `Note #${note_id} deleted from issue #${issue_id}.` }], }; } catch (error) { const msg = error instanceof Error ? error.message : String(error); return { content: [{ type: 'text', text: errorText(msg) }], isError: true }; } } ); - src/tools/notes.ts:108-126 (registration)Registration of 'delete_note' tool via server.registerTool with title, description, inputSchema (issue_id, note_id), and annotations (not read-only, destructive, idempotent).
server.registerTool( 'delete_note', { title: 'Delete Note', description: `Permanently delete a note from a MantisBT issue. This action is irreversible — deleted notes cannot be recovered. Returns a plain-text confirmation message on success. Returns an error if the note does not exist or the current user lacks permission to delete it (MantisBT enforces access control: users can typically only delete their own notes unless they have manager-level access or higher). Prerequisites: obtain note_id from list_notes or from get_issue (notes[].id); obtain issue_id from the same source.`, inputSchema: z.object({ issue_id: z.coerce.number().int().positive().describe('Numeric issue ID that owns the note — use get_issue or list_notes to identify this value'), note_id: z.coerce.number().int().positive().describe('Numeric note ID to delete — obtain from get_issue (notes[].id) or list_notes'), }), annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true, }, }, - src/tools/notes.ts:117-120 (schema)Input schema for delete_note: issue_id and note_id, both coerced positive integers.
inputSchema: z.object({ issue_id: z.coerce.number().int().positive().describe('Numeric issue ID that owns the note — use get_issue or list_notes to identify this value'), note_id: z.coerce.number().int().positive().describe('Numeric note ID to delete — obtain from get_issue (notes[].id) or list_notes'), }), - src/index.ts:68-68 (registration)Registration call: registerNoteTools(server, client) invoked in the main index.ts to wire up all note tools including delete_note.
registerNoteTools(server, client);