Skip to main content
Glama
disnet
by disnet

delete_note

Remove unwanted notes permanently from your Flint Note vault to maintain organized, clutter-free documentation. This tool requires explicit confirmation before deletion.

Instructions

Delete an existing note permanently

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
identifierYesNote identifier (type/filename format)
confirmNoExplicit confirmation required for deletion
vault_idNoOptional vault ID to operate on. If not provided, uses the current active vault.

Implementation Reference

  • MCP tool handler implementation for 'delete_note'. Validates arguments using validateToolArgs('delete_note', args), resolves vault context, calls noteManager.deleteNote(identifier, confirm), and returns formatted success/error 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
        };
      }
    };
  • Input schema definition for the 'delete_note' tool, specifying parameters: identifier (required string), confirm (boolean, default false), vault_id (optional string).
    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']
    }
  • Registration of 'delete_note' tool in MCP CallToolRequestSchema handler, dispatching to noteHandlers.handleDeleteNote
    return await this.noteHandlers.handleDeleteNote(
      args as unknown as DeleteNoteArgs
    );
  • Core NoteManager.deleteNote method implementing the file deletion logic: validates deletion safety, checks config/confirmation, creates backup if enabled, removes from search index, unlinks the file, returns DeleteNoteResult.
    async deleteNote(
      identifier: string,
      confirm: boolean = false
    ): Promise<DeleteNoteResult> {
      try {
        const config = this.#workspace.getConfig();
    
        // Validate deletion
        const validation = await this.validateNoteDeletion(identifier);
        if (!validation.can_delete) {
          throw new Error(`Cannot delete note: ${validation.errors.join(', ')}`);
        }
    
        // Check confirmation requirement
        if (config?.deletion?.require_confirmation && !confirm) {
          throw new Error(`Deletion requires confirmation. Set confirm=true to proceed.`);
        }
    
        const {
          typeName: _typeName,
          filename: _filename,
          notePath
        } = this.parseNoteIdentifier(identifier);
    
        let backupPath: string | undefined;
    
        // Create backup if enabled
        if (config?.deletion?.create_backups) {
          const backup = await this.createNoteBackup(notePath);
          backupPath = backup.path;
        }
    
        // Remove from search index first
        await this.removeFromSearchIndex(notePath);
    
        // Delete the file
        await fs.unlink(notePath);
    
        return {
          id: identifier,
          deleted: true,
          timestamp: new Date().toISOString(),
          backup_path: backupPath,
          warnings: validation.warnings
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : 'Unknown error';
        throw new Error(`Failed to delete note '${identifier}': ${errorMessage}`);
      }
    }
  • TypeScript interface DeleteNoteArgs defining the input parameters for the delete_note tool.
    export interface DeleteNoteArgs {
      identifier: string;
      confirm?: boolean;
      vault_id?: string;
    }
Behavior2/5

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

With no annotations provided, the description carries full burden. It states the deletion is 'permanent', which is crucial behavioral context. However, it doesn't mention permissions required, error conditions, what happens to linked data, or confirmation workflow details beyond the schema's 'confirm' parameter.

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 a single, efficient sentence with zero wasted words. It's front-loaded with the core action and includes the critical 'permanently' qualifier. Every word earns its place.

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

Completeness2/5

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

For a destructive mutation tool with no annotations and no output schema, the description is inadequate. It should explain more about the confirmation workflow, what 'permanently' entails, potential side effects on linked notes, and error scenarios. The current description leaves too many behavioral questions unanswered.

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?

Schema description coverage is 100%, so the schema fully documents all three parameters. The description adds no additional parameter semantics beyond what's in the schema descriptions. Baseline 3 is appropriate when schema does all the parameter documentation work.

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

Purpose4/5

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

The description clearly states the action ('Delete') and resource ('an existing note'), specifying it's a permanent deletion. It distinguishes from 'bulk_delete_notes' by being singular, but doesn't explicitly differentiate from other deletion tools like 'delete_note_type' or 'remove_vault'.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'bulk_delete_notes' for multiple deletions or 'rename_note' for non-destructive changes. It mentions 'permanently' which hints at irreversibility, but offers no explicit usage context or prerequisites.

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/disnet/flint-note'

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