delete_note
Remove a specific note permanently from Flint Note's vault. Requires a note identifier and optional explicit confirmation to ensure accurate deletion.
Instructions
Delete an existing note permanently
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | No | Explicit confirmation required for deletion | |
| identifier | Yes | Note identifier (type/filename format) | |
| vault_id | No | Optional vault ID to operate on. If not provided, uses the current active vault. |
Input Schema (JSON Schema)
{
"properties": {
"confirm": {
"default": false,
"description": "Explicit confirmation required for deletion",
"type": "boolean"
},
"identifier": {
"description": "Note identifier (type/filename format)",
"type": "string"
},
"vault_id": {
"description": "Optional vault ID to operate on. If not provided, uses the current active vault.",
"type": "string"
}
},
"required": [
"identifier"
],
"type": "object"
}
Implementation Reference
- src/server/note-handlers.ts:348-391 (handler)The main handler function for the 'delete_note' MCP tool. Validates input, resolves vault context, calls the core noteManager.deleteNote method, and returns a formatted response.handleDeleteNote = async (args: DeleteNoteArgs) => { try { // Validate arguments validateToolArgs('delete_note', args); const { noteManager } = await this.resolveVaultContext(args.vault_id); const result = await noteManager.deleteNote(args.identifier, args.confirm); return { content: [ { type: 'text', text: JSON.stringify( { success: true, message: `Note '${args.identifier}' deleted successfully`, result }, null, 2 ) } ] }; } catch (error) { const errorMessage = error instanceof Error ? error.message : 'Unknown error'; return { content: [ { type: 'text', text: JSON.stringify( { success: false, error: errorMessage }, null, 2 ) } ], isError: true }; } };
- src/server/tool-schemas.ts:710-731 (schema)JSON schema definition for the 'delete_note' tool inputs, including identifier, confirm flag, and optional vault_id.name: 'delete_note', description: 'Delete a specific note', inputSchema: { type: 'object', properties: { identifier: { type: 'string', description: 'Note identifier in type/filename format' }, confirm: { type: 'boolean', description: 'Confirmation flag to prevent accidental deletion', default: false }, vault_id: { type: 'string', description: 'Optional vault ID to operate on. If not provided, uses the current active vault.' } }, required: ['identifier', 'confirm'] }
- src/server.ts:1305-1308 (registration)Registration of the 'delete_note' tool handler in the MCP server's CallToolRequestSchema switch statement.case 'delete_note': return await this.noteHandlers.handleDeleteNote( args as unknown as DeleteNoteArgs );
- src/server/types.ts:166-170 (schema)TypeScript interface defining the arguments for the delete_note tool handler.export interface DeleteNoteArgs { identifier: string; confirm?: boolean; vault_id?: string; }
- src/server/validation.ts:402-426 (helper)Validation rules for 'delete_note' tool arguments, including format check for identifier.delete_note: [ { field: 'identifier', required: true, type: 'string', allowEmpty: false, customValidator: (value: any) => { if (!value.includes('/')) { return 'identifier must be in format "type/filename"'; } return null; } }, { field: 'confirm', required: false, type: 'boolean' }, { field: 'vault_id', required: false, type: 'string', allowEmpty: false } ],