Skip to main content
Glama

delete_note

Remove notes from your Obsidian vault to declutter your knowledge base and maintain organized documentation.

Instructions

Delete a note from the Obsidian vault

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the note within the vault

Implementation Reference

  • src/index.ts:1118-1130 (registration)
    Tool registration in the ListToolsRequestSchema handler, including name, description, and input schema.
      name: 'delete_note',
      description: 'Delete a note from the Obsidian vault',
      inputSchema: {
        type: 'object',
        properties: {
          path: {
            type: 'string',
            description: 'Path to the note within the vault',
          },
        },
        required: ['path'],
      },
    },
  • MCP tool handler that validates input and calls the deleteNote implementation.
    private async handleDeleteNote(args: any) {
      if (!args?.path) {
        throw new Error('Path is required');
      }
      
      await this.deleteNote(args.path);
      
      return {
        content: [
          {
            type: 'text',
            text: `Note deleted successfully: ${args.path}`,
          },
        ],
      };
    }
  • Core implementation that deletes the note file using Obsidian REST API or direct filesystem unlink with directory cleanup.
    private async deleteNote(notePath: string): Promise<void> {
      try {
        // First try using the Obsidian API
        await this.api.delete(`/vault/${encodeURIComponent(notePath)}`);
      } catch (error) {
        console.warn('API request failed, falling back to file system:', error);
        
        // Fallback to file system if API fails
        const fullPath = path.join(VAULT_PATH, notePath);
        
        if (!fs.existsSync(fullPath)) {
          throw new Error(`Note not found: ${notePath}`);
        }
        
        fs.unlinkSync(fullPath);
        
        // Check if parent directory is empty and remove it if it is
        const dir = path.dirname(fullPath);
        if (dir !== VAULT_PATH) {
          const items = fs.readdirSync(dir);
          if (items.length === 0) {
            fs.rmdirSync(dir);
          }
        }
      }
    }
  • src/index.ts:1396-1397 (registration)
    Dispatch registration in the CallToolRequestSchema switch statement.
    case 'delete_note':
      return await this.handleDeleteNote(request.params.arguments);
  • Input schema definition requiring a 'path' parameter.
      type: 'object',
      properties: {
        path: {
          type: 'string',
          description: 'Path to the note within the vault',
        },
      },
      required: ['path'],
    },
Behavior2/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 states the tool deletes a note, implying a destructive mutation, but fails to describe critical traits like whether deletion is permanent or reversible, what permissions are required, or if there are side effects like broken links. This leaves significant gaps in understanding the tool's behavior.

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, direct sentence with zero wasted words, making it highly concise and front-loaded. It efficiently communicates the core action without unnecessary elaboration.

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?

Given the tool's destructive nature, lack of annotations, and no output schema, the description is incomplete. It does not address behavioral risks, return values, or error handling, which are crucial for a deletion operation. This leaves the agent with insufficient context for safe and effective use.

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 'path' parameter clearly documented. The description does not add any meaning beyond what the schema provides, such as examples of valid paths or constraints. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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 the resource ('a note from the Obsidian vault'), making the purpose unambiguous. However, it does not explicitly differentiate from sibling tools like 'move_note' or 'update_note' beyond the verb, which slightly limits its distinction.

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, such as 'move_note' for relocation or 'update_note' for modification. It lacks context about prerequisites, like ensuring the note exists, or exclusions, such as not using it for non-note files.

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/newtype-01/obsidian-mcp'

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