list_directory:The 'list_directory' tool allows users to retrieve a list of files and directories within a specified folder. It requires a single parameter, 'dir_path', which is a string representing the path to the subdirectory you wish to list. If 'dir_path' is not provided, the tool defaults to listing the contents of the current directory ('.'). The tool returns a list of file and directory names within the specified path. If the specified directory does not exist, an error message will be returned, indicating the directory could not be found. Users should ensure they have the necessary permissions to access the directories they wish to list, as permission issues may prevent access. Note that the tool's behavior may vary depending on the operating system or environment in which it is used. The tool may not handle directories with a very large number of files efficiently, so users should be aware of potential performance limitations in such cases. Additionally, users should be cautious of special characters or spaces in directory names, as these may affect the tool's ability to locate the directory correctly.
copy_file:The 'copy_file' tool enables you to duplicate a file from a specified source path to a designated destination path, strictly within the current working directory. It requires two parameters: 'source_path', the path of the file you wish to copy, and 'destination_path', where the copied file will be saved. The tool enforces strict access restrictions, allowing operations only within the current working directory. Attempting to copy files from or to locations outside this directory will result in an 'Access denied' error. Users must ensure that both the source and destination paths are within the current working directory and that the tool has the necessary permissions to access these paths.
write_file:The 'write_file' tool allows users to write text to a specified file on disk. It can create a new file or modify an existing one. The tool requires three parameters: 'file_path' (a string specifying the name of the file), 'text' (the content to be written), and 'append' (a boolean indicating whether to append to an existing file, with the default being false, which overwrites the file). Ensure the 'text' parameter is properly formatted to avoid syntax errors. The tool provides a success message when the operation is successful and detailed error messages for issues such as invalid file paths or permission problems. Users should be mindful of potential limitations when handling very large inputs, though specific guidance on what constitutes 'very large' is not provided. An example use case is appending log entries to a file, ensuring logs are preserved across multiple script executions.
read_file:The read_file tool reads the contents of a file from disk. It requires a 'file_path' parameter, which specifies the name of the file. The tool can only access files located in the current working directory, where it is executed. If the file is successfully found and accessed, its contents are returned in the 'response' field. If the file is not found or access is denied, an error message is returned, such as 'Error: no such file or directory' or 'Error: Access denied to file_path'. Users should ensure the file path is correct, the file is within the accessible directory, and they have the necessary permissions to read the file.
move_file:The 'move_file' tool enables moving or renaming a file from one location to another. It requires two parameters: 'source_path', the path of the file to be moved, and 'destination_path', the new path for the moved file. The tool necessitates appropriate permissions to access both the source and destination paths. If there are permission issues or other errors, the tool will return an error message indicating the problem. The tool may have environment constraints, such as operating only within certain directories or the current working directory. Additionally, if a file with the same name already exists at the destination path, the tool may not overwrite it, potentially resulting in an error. Example usage: To move a file from '/home/user/documents/report.txt' to '/home/user/backup/report.txt', set 'source_path' to '/home/user/documents/report.txt' and 'destination_path' to '/home/user/backup/report.txt'.
file_delete:The 'file_delete' tool allows users to delete a specified file by providing its file path. The required parameter is 'file_path', which is a string indicating the path of the file to be deleted. The tool operates under specific constraints: it can only delete files within the current working directory, and users must have the necessary permissions to delete the file. If the file does not exist, the tool will return an error message stating 'Error: no such file or directory: [file_path]'. Users should ensure the file path is correct, the file exists, and that they have the necessary permissions before attempting deletion. Special characters in file names should be handled correctly to avoid errors. Understanding these constraints is crucial for effective use of the tool.
file_search:The 'file_search' tool allows users to recursively search for files within a specified subdirectory that match a given shell-style glob pattern. The search includes all subdirectories within the specified 'dir_path'. The tool requires two parameters: 'dir_path', a string indicating the subdirectory to search in, which defaults to the current directory ('.') if not specified, and 'pattern', a shell-style glob pattern where '*' matches any sequence of characters and '{a,b}' matches either 'a' or 'b'. The output includes an 'error' field for any issues encountered during the search, such as permission errors or invalid directory paths, and a 'response' field containing a list of matching file paths if files are found, or a message indicating no files were found if none match the pattern. Example usage: To find all JPEG and PNG files in the 'photos/vacation/2022' directory, use 'dir_path': 'photos/vacation/2022' and 'pattern': '*.{jpg,jpeg,png}'. Ensure that the directory path is correct and accessible to avoid errors.