Skip to main content
Glama
tan-yong-sheng

TriliumNext Notes' MCP Server

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);
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively communicates critical behavioral traits: the action is permanent ('cannot be undone'), destructive ('permanently remove the note and all its content'), and requires explicit user intent. However, it lacks details on error handling, permissions, or rate limits, which are relevant for a destructive operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with the core purpose stated first ('Delete a note permanently'). Each sentence adds value: usage guidelines, cautionary notes, and irreversible consequences. There is no redundant or unnecessary information, making it efficient and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (destructive operation with no annotations or output schema), the description is mostly complete. It covers purpose, usage constraints, and behavioral risks. However, it could be more complete by mentioning potential errors (e.g., invalid noteId) or confirming deletion success, though the absence of an output schema reduces the need for return value details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'noteId' parameter clearly documented. The description does not add any additional meaning or context about the parameter beyond what the schema provides, such as format examples or validation rules. This meets the baseline score of 3 for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('delete permanently') and resource ('a note'), distinguishing it from siblings like 'update_note' or 'get_note'. It explicitly mentions the permanent removal of content, which sets it apart from tools that might archive or modify notes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance on when to use this tool ('ONLY use this tool when the user explicitly requests note deletion') and when not to use it ('TRY NOT to use this tool proactively or for automated cleanup'). It includes examples of user requests (e.g., 'delete the note') to clarify the context, though it does not name specific alternative tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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