delete_note
Remove notes from your Obsidian vault to declutter and organize your knowledge base by specifying the file path.
Instructions
Delete a note from the Obsidian vault
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the note to delete relative to vault root |
Implementation Reference
- src/index.ts:453-462 (handler)The main handler function for the delete_note tool. It resolves the full file path, checks if the note exists, deletes the file using fs.unlink, and returns a success message.async function handleDeleteNote(args: { path: string }): Promise<string> { const fullPath = resolvePath(args.path); if (!(await fileExists(fullPath))) { throw new Error(`Note not found at ${args.path}`); } await fs.unlink(fullPath); return `Successfully deleted note at ${args.path}`; }
- src/index.ts:53-62 (schema)Input schema for the delete_note tool, specifying a required 'path' parameter of type string.inputSchema: { type: "object", properties: { path: { type: "string", description: "Path to the note to delete relative to vault root", }, }, required: ["path"], },
- src/index.ts:50-63 (registration)Registration of the delete_note tool in the tools array, including name, description, and input schema. This is used by the ListTools handler.{ name: "delete_note", description: "Delete a note from the Obsidian vault", inputSchema: { type: "object", properties: { path: { type: "string", description: "Path to the note to delete relative to vault root", }, }, required: ["path"], }, },
- src/index.ts:870-871 (registration)Switch case in the CallToolRequestSchema handler that routes calls to delete_note to the handleDeleteNote function.case "delete_note": result = await handleDeleteNote(args as { path: string });