delete_item
Remove files or directories from your Obsidian vault to manage storage and organize notes.
Instructions
Delete a file or directory from the vault
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path to the item to delete |
Implementation Reference
- src/index.ts:123-127 (handler)The core handler function in ObsidianApiClient that executes the DELETE request to the Obsidian REST API endpoint `/files/{path}` to delete the specified file or directory.async deleteItem(path: string) { return this.request(`/files/${encodeURIComponent(path)}`, { method: "DELETE", }); }
- src/index.ts:314-324 (schema)Tool schema definition including name, description, and input schema requiring a 'path' string parameter.{ name: "delete_item", description: "Delete a file or directory from the vault", inputSchema: { type: "object", properties: { path: { type: "string", description: "Path to the item to delete" }, }, required: ["path"], }, },
- src/index.ts:472-474 (registration)Tool call dispatcher in the CallToolRequestHandler switch statement that routes 'delete_item' calls to the client.deleteItem handler.case "delete_item": result = await this.client.deleteItem(args?.path as string); break;