delete_item
Remove files or directories from an Obsidian vault by specifying their path using this tool, integrated with the Obsidian Local REST API MCP Server.
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)Core implementation of the delete_item tool: sends a 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:317-323 (schema)Input schema definition for the delete_item tool, specifying that a 'path' string parameter is required.inputSchema: { type: "object", properties: { path: { type: "string", description: "Path to the item to delete" }, }, required: ["path"], },
- src/index.ts:314-324 (registration)Tool registration in the ListTools response: defines name, description, and input schema for delete_item.{ 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 (handler)Dispatcher in CallToolRequestHandler that routes 'delete_item' calls to the ObsidianApiClient.deleteItem method.case "delete_item": result = await this.client.deleteItem(args?.path as string); break;