UNPKG

@cyanheads/filesystem-mcp-server

Version:

A Model Context Protocol (MCP) server for platform-agnostic file capabilities, including advanced search and replace, and directory tree traversal

28 lines (27 loc) 1.14 kB
import { z } from 'zod'; import { RequestContext } from '../../../utils/internal/requestContext.js'; export declare const DeleteDirectoryInputSchema: z.ZodObject<{ path: z.ZodString; recursive: z.ZodDefault<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { path: string; recursive: boolean; }, { path: string; recursive?: boolean | undefined; }>; export type DeleteDirectoryInput = z.infer<typeof DeleteDirectoryInputSchema>; export interface DeleteDirectoryOutput { message: string; deletedPath: string; wasRecursive: boolean; } /** * Deletes a specified directory, optionally recursively. * * @param {DeleteDirectoryInput} input - The input object containing path and recursive flag. * @param {RequestContext} context - The request context. * @returns {Promise<DeleteDirectoryOutput>} A promise resolving with the deletion status. * @throws {McpError} For path errors, directory not found, not a directory, directory not empty (if not recursive), or I/O errors. */ export declare const deleteDirectoryLogic: (input: DeleteDirectoryInput, context: RequestContext) => Promise<DeleteDirectoryOutput>;