diff --git a/src/filesystem/index.ts b/src/filesystem/index.ts index 7b67e63e58..7603f9ce5e 100644 --- a/src/filesystem/index.ts +++ b/src/filesystem/index.ts @@ -94,13 +94,13 @@ setAllowedDirectories(allowedDirectories); // Schema definitions const ReadTextFileArgsSchema = z.object({ - path: z.string(), + path: z.string().describe('Absolute path to the file to read'), tail: z.number().optional().describe('If provided, returns only the last N lines of the file'), head: z.number().optional().describe('If provided, returns only the first N lines of the file') }); const ReadMediaFileArgsSchema = z.object({ - path: z.string() + path: z.string().describe('Absolute path to the media file to read') }); const ReadMultipleFilesArgsSchema = z.object({ @@ -111,8 +111,8 @@ const ReadMultipleFilesArgsSchema = z.object({ }); const WriteFileArgsSchema = z.object({ - path: z.string(), - content: z.string(), + path: z.string().describe('Absolute path to the file to write'), + content: z.string().describe('Content to write to the file'), }); const EditOperation = z.object({ @@ -121,42 +121,42 @@ const EditOperation = z.object({ }); const EditFileArgsSchema = z.object({ - path: z.string(), - edits: z.array(EditOperation), + path: z.string().describe('Absolute path to the file to edit'), + edits: z.array(EditOperation).describe('Array of edit operations to apply'), dryRun: z.boolean().default(false).describe('Preview changes using git-style diff format') }); const CreateDirectoryArgsSchema = z.object({ - path: z.string(), + path: z.string().describe('Absolute path to the directory to create'), }); const ListDirectoryArgsSchema = z.object({ - path: z.string(), + path: z.string().describe('Absolute path to the directory to list'), }); const ListDirectoryWithSizesArgsSchema = z.object({ - path: z.string(), + path: z.string().describe('Absolute path to the directory to list'), sortBy: z.enum(['name', 'size']).optional().default('name').describe('Sort entries by name or size'), }); const DirectoryTreeArgsSchema = z.object({ - path: z.string(), - excludePatterns: z.array(z.string()).optional().default([]) + path: z.string().describe('Absolute path to the root directory for the tree'), + excludePatterns: z.array(z.string()).optional().default([]).describe('Array of glob patterns to exclude from the tree') }); const MoveFileArgsSchema = z.object({ - source: z.string(), - destination: z.string(), + source: z.string().describe('Absolute path of the source file to move'), + destination: z.string().describe('Absolute path of the destination'), }); const SearchFilesArgsSchema = z.object({ - path: z.string(), - pattern: z.string(), - excludePatterns: z.array(z.string()).optional().default([]) + path: z.string().describe('Absolute path to the directory to search in'), + pattern: z.string().describe('Glob pattern to match files against'), + excludePatterns: z.array(z.string()).optional().default([]).describe('Array of glob patterns to exclude from search') }); const GetFileInfoArgsSchema = z.object({ - path: z.string(), + path: z.string().describe('Absolute path to the file to get information about'), }); // Server setup