Skip to main content
Glama
YanceyOfficial

Obsidian iCloud MCP

remove_directory

Delete specified directories in Obsidian vaults stored on iCloud Drive using the Model Context Protocol to manage file structures efficiently.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes

Implementation Reference

  • The main handler function for the remove_directory tool. Parses input arguments using RemoveDirectoryArgsSchema, removes the specified directory using the rimraf library, and returns a textual response with the result.
    export async function removeDirectory(args?: Record<string, unknown>) { const parsed = RemoveDirectoryArgsSchema.safeParse(args) if (!parsed.success) { throw new Error(`Invalid arguments for remove_directory: ${parsed.error}`) } const result = await rimraf(parsed.data.path) return { content: [{ type: 'text', text: result }] } }
  • Zod schema defining the input for remove_directory: requires a 'path' string parameter.
    export const RemoveDirectoryArgsSchema = z.object({ path: z.string() })
  • src/index.ts:141-144 (registration)
    Registration of the remove_directory tool in the ListToolsRequestHandler response. Specifies the tool name, description from prompt (which is empty), and converts the Zod schema to JSON schema for input validation.
    name: 'remove_directory', description: removeDirectoryPrompt(), inputSchema: zodToJsonSchema(RemoveDirectoryArgsSchema) as ToolInput },
  • src/index.ts:203-205 (registration)
    Dispatch logic in the CallToolRequestHandler switch statement that routes calls to the remove_directory tool by invoking the removeDirectory function from file-system.ts.
    case 'remove_directory': { return removeDirectory(args) }
  • Import of RemoveDirectoryArgsSchema (among others) from schemas.ts into file-system.ts, enabling validation within the handler.
    CreateDirectoryArgsSchema, EditFileArgsSchema, FullTextSearchArgsSchema, ListDirectoryArgsSchema, MoveFileArgsSchema, ReadFileArgsSchema, ReadMultipleFilesArgsSchema, RemoveDirectoryArgsSchema, RemoveFileArgsSchema, RemoveMultipleDirectoryArgsSchema, RemoveMultipleFilesArgsSchema, WriteFileArgsSchema } from './schemas.js'

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

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