Skip to main content
Glama

delete_note

Permanently remove a note and all its content from TriliumNext Notes. Use only when explicitly requested, as this action cannot be undone.

Instructions

Delete a note permanently. ONLY use this tool when the user explicitly requests note deletion (e.g., 'delete the note', 'remove this note', 'delete this permanently'). TRY NOT to use this tool proactively or for automated cleanup. CAUTION: This action cannot be undone and will permanently remove the note and all its content.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
noteIdYesID of the note to delete

Implementation Reference

  • Core handler function that executes the delete_note tool logic by calling the Trilium API DELETE /notes/{noteId} endpoint.
    export async function handleDeleteNote( args: NoteOperation, axiosInstance: any ): Promise<NoteDeleteResponse> { const { noteId } = args; if (!noteId) { throw new Error("noteId is required for delete operation."); } await axiosInstance.delete(`/notes/${noteId}`); return { noteId, message: `Deleted note: ${noteId}` }; }
  • MCP-specific request handler for delete_note that performs permission checks, prepares arguments, calls the core handler, and formats the MCP response.
    export async function handleDeleteNoteRequest( args: any, axiosInstance: any, permissionChecker: PermissionChecker ): Promise<{ content: Array<{ type: string; text: string }> }> { if (!permissionChecker.hasPermission("WRITE")) { throw new McpError(ErrorCode.InvalidRequest, "Permission denied: Not authorized to delete notes."); } try { const noteOperation: NoteOperation = { noteId: args.noteId }; const result = await handleDeleteNote(noteOperation, axiosInstance); return { content: [{ type: "text", text: result.message }] }; } catch (error) { if (error instanceof McpError) { throw error; } throw new McpError(ErrorCode.InvalidParams, error instanceof Error ? error.message : String(error)); }
  • Input schema and description definition for the delete_note tool.
    name: "delete_note", description: "Delete a note permanently. ONLY use this tool when the user explicitly requests note deletion (e.g., 'delete the note', 'remove this note', 'delete this permanently'). TRY NOT to use this tool proactively or for automated cleanup. CAUTION: This action cannot be undone and will permanently remove the note and all its content.", inputSchema: { type: "object", properties: { noteId: { type: "string", description: "ID of the note to delete", }, }, required: ["noteId"], },
  • src/index.ts:99-100 (registration)
    Registration of the delete_note tool handler in the main MCP server request router.
    case "delete_note": return await handleDeleteNoteRequest(request.params.arguments, this.axiosInstance, this);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tan-yong-sheng/triliumnext-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server