list_directory:The 'list_directory' tool enables users to list 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. The default value for 'dir_path' is the current directory ('.'). If the specified directory does not exist, the tool will return an error message indicating that the directory could not be found. Additionally, the tool may return an 'Access denied' error if the user does not have the necessary permissions to access the specified directory. It is important to ensure that the 'dir_path' parameter is a valid path on the system where the tool is being executed and that the user has the appropriate permissions to access the directory.
copy_file:The 'copy_file' tool allows users 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', which is the path of the file to be copied, and 'destination_path', where the copied file will be saved. The tool enforces strict permission constraints, only permitting file operations within the current working directory. Attempts to copy files from or to locations outside this directory will result in an 'Access denied' error. Users must ensure they have the necessary permissions for both the source and destination paths before using the tool. The tool does not handle permission modifications, symbolic links, or support copying large files if they exceed the directory's permission limits. Additionally, users should verify that the source file is not a symbolic link, as the tool does not explicitly handle symbolic links.
write_file:The 'write_file' tool enables writing text to a file on disk. It requires the following parameters: 'file_path' (str) to specify the file name, 'text' (str) for the content to be written, and 'append' (bool) to determine whether to append the text to an existing file (true) or overwrite it (false, default). If 'append' is not specified, the file will be overwritten by default. The tool provides feedback through an API response, which includes an 'error' field for any issues encountered, such as syntax errors in the 'text' parameter, file permission errors, or invalid file paths, and a 'response' field indicating success. Users should ensure that the 'text' parameter is properly formatted and escaped to avoid syntax errors, such as 'EOL while scanning string literal'. Example usage: To add text to an existing file without overwriting, set 'append' to true. For instance, writing 'Meeting scheduled for Monday at 10 AM.' to 'meeting_notes.txt' with 'append' set to true will preserve existing content. In case of errors, users should check the 'error' field and take corrective action, such as correcting the text format or checking file permissions. A troubleshooting section is recommended for resolving common issues.
read_file:The read_file tool is designed to read the contents of a file located within the current working directory. It requires a single parameter, 'file_path', which specifies the relative path to the file from the current working directory. The tool does not support accessing files outside of this directory. If the specified file cannot be found or if there is an issue with access permissions, the tool will return an error message indicating the problem. It is crucial to ensure that the file path is correct and that the file exists within the current working directory to avoid errors.
move_file:The 'move_file' tool allows you to move or rename a file within your file system. It requires two parameters: 'source_path', which is the current path of the file you wish to move, and 'destination_path', which is the new path where you want the file to be moved. Ensure both paths are accurate and that the source file exists, as the tool will return an error if the source file is not found. The tool is designed for operations within the same file system and may not support cross-file system moves. It may also encounter permission issues if the paths are outside the current working directory, so verify that you have the necessary permissions for both paths. Additionally, the tool may not handle symbolic links correctly. Common errors include 'Access denied' due to insufficient permissions, which can be resolved by verifying permissions.
file_delete:The 'file_delete' tool is designed to delete a specified file from the system. It requires a single parameter: 'file_path', which is the path to the file you wish to delete. The tool will attempt to delete the file at the specified path and provide feedback on the operation's success or failure.\n\n**Error Handling**: If the file does not exist at the given path, the tool will return an error message indicating 'no such file or directory'. If the user lacks the necessary permissions to delete the file, the tool will return an error message such as 'Error: Access denied to file_path: ... Permission granted exclusively to the current working directory'.\n\n**Preconditions**: The file path must be valid, and the user or system executing the command must have the appropriate permissions to delete the file.\n\n**Expected Behavior**: A successful operation will result in the file being deleted without any error message. If an error occurs, the tool will provide a descriptive error message.\n\n**Security Considerations**: Ensure that the user has the necessary permissions to delete the specified file. Permissions may be restricted to certain directories or users, so users should be aware of their working directory or user role.\n\n**Examples**:\n- Valid Input: {'file_path': 'C:/Users/John/Documents/Work/draft_report.docx'}\n  - Expected Output: File is deleted successfully, no error message.\n- Invalid Input: {'file_path': 'C:/Users/John/Documents/Work/non_existent_file.docx'}\n  - Expected Output: Error message 'no such file or directory'.\n- Invalid Input: {'file_path': '/home/user/secure/confidential_notes.txt'}\n  - Expected Output: Error message 'Error: Access denied to file_path: /home/user/secure/confidential_notes.txt. Permission granted exclusively to the current working directory'.
file_search:The 'file_search' tool allows users to recursively search for files within a specified subdirectory that match a given pattern using Unix shell-style globbing. The pattern supports flexible matching: '*' matches any sequence of characters, '?' matches a single character, and '[...]' matches any one of the enclosed characters. The required parameters are 'dir_path', which specifies the subdirectory to search in, and 'pattern', which defines the file matching criteria. The tool returns a list of files that match the pattern or a message indicating no files were found if there are no matches. It is important to note that the tool does not return an error message when no files are found, only a message stating no matches were found. Example usage includes finding all PDF files in a directory with 'pattern' set to '*.pdf', or locating text files starting with any lowercase letter using 'pattern' set to '[a-z]*.txt'. The search is recursive, meaning it includes all subdirectories within the specified path. Ensure that the pattern is correctly specified to match the intended files.