Skip to main content
Glama
j-shelfwood

Obsidian Local REST API MCP Server

by j-shelfwood

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
NameRequiredDescriptionDefault
pathYesPath to the item to delete

Implementation Reference

  • 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", }); }
  • 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"], }, },
  • 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;

Other Tools

Related 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/j-shelfwood/obsidian-local-rest-api-mcp'

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