list_directory:This tool lists files and directories within a specified folder. It requires a 'dir_path' parameter, which must be a valid and existing directory path within the current working directory. If the directory does not exist, or if the directory path is incorrectly formatted (such as not handling spaces properly), an error message will be returned. The tool does not have any optional parameters. It is restricted to listing directories within the current working directory, and attempting to access directories outside of this scope will result in an 'Access denied' error. To correctly format directory names with spaces, enclose them in quotes or use escape characters. Examples of valid 'dir_path' inputs include './my_folder', './my projects', or './another_folder'.
copy_file:The 'copy_file' tool allows you to duplicate a file from a specified source path to a designated destination path within the current working directory. It requires two parameters: 'source_path', which is the path of the file you wish to copy, and 'destination_path', which is the path where the copied file will be saved. Key considerations include: 1) The tool is restricted to accessing files within the current working directory. Attempting to copy files to or from directories outside this scope will result in an 'Access denied' error. 2) If the 'source_path' does not exist, the tool will return an error indicating that the file or directory was not found. Ensure the file paths provided are accurate and that the files exist at the specified locations. 3) To handle permission errors, ensure you have the necessary file permissions and execute the tool with the appropriate privileges. 4) The tool does not support copying symbolic links; it treats them as regular files and will attempt to copy the link itself rather than the file it points to.
write_file:The 'write_file' tool allows you to write text to a file on disk. It requires three parameters: 'file_path' (a string specifying the full path and name of the file), 'text' (a string containing the text to write), and 'append' (a boolean indicating whether to append to an existing file, defaulting to false). If 'append' is set to false, the tool will overwrite any existing file with the same name. Ensure the 'text' parameter is properly formatted to avoid errors, such as 'EOL while scanning string literal'. Use triple quotes or escape characters for multi-line strings. The tool does not support writing to non-existent directories or paths inaccessible from the current execution environment. Common errors include 'No such file or directory', which can be resolved by verifying the file path and ensuring directory permissions are correct. Before writing, check if the directory exists and create it if necessary. The tool must be executed in an environment with access to the specified path. Example usage: Verify the directory path exists and is accessible from the execution environment before writing a file to avoid errors.
read_file:The 'read_file' tool allows users to read the contents of a file from disk. It requires a single parameter, 'file_path', which specifies the path to the file. The tool is restricted to accessing files within the current working directory, and attempts to access files outside this directory will result in an error. The output of the tool includes an 'error' field, which will contain an error message if the file cannot be accessed due to permission issues or if the file does not exist. If the file is successfully accessed, the contents will be returned in the 'response' field. Note that error messages related to file access issues, such as 'no such file or directory', should be expected in the 'error' field. Users should ensure that the specified 'file_path' is correct and within the allowed directory to avoid errors. Example usage: To read a file named 'example.txt' in the current directory, set 'file_path' to 'example.txt'.
move_file:The 'move_file' tool allows you to move or rename a file from one location to another on your file system. It requires two parameters: 'source_path', which is the path of the file you want to move, and 'destination_path', which is the new path where the file should be moved. The tool does not create directories if the destination path does not exist, so ensure the destination directory is pre-existing. If the source file does not exist, the tool will return an error message in the 'response' field, such as 'Error: no such file or directory'. If a file with the same name already exists at the destination, the tool will overwrite it without prompting. Paths should be specified in a format compatible with your operating system. For example, on Unix-based systems, paths might look like '/home/user/file.txt', while on Windows, they might look like 'C:\\Users\\User\\file.txt'. Common errors include 'no such file or directory' for a missing source file, 'destination path does not exist' for a non-existent destination directory, and permission issues. The tool treats symbolic links the same as regular files, so ensure the link itself exists and is correctly specified. If the symbolic link points to a non-existent file or directory, it will result in an error.
file_delete:The 'file_delete' tool enables the deletion of a file specified by its path. The file must reside in the current working directory, and the user must have the necessary permissions to delete it. If the file is not found at the specified path, the tool will return an error message indicating 'no such file or directory'. It is crucial to ensure that the file path is correct and relative to the current working directory. The tool does not support deleting files located in subdirectories outside the current working directory. Additionally, file names and paths should not contain special characters or spaces that could interfere with file path recognition. If special characters are present, they must be correctly handled or escaped.
file_search:The 'file_search' tool enables users to recursively search for files within a specified subdirectory that match a given pattern using Unix shell-style wildcards. The '*' wildcard matches any sequence of characters, and patterns can include multiple file extensions using syntax like '*.{jpg,png}'. Required parameters are 'dir_path', which specifies the subdirectory to search (defaulting to the current working directory if not provided), and 'pattern', which defines the file name pattern to match. The tool returns a list of file paths that match the pattern. If no files are found, a message indicating this is returned. Error handling includes responses for non-existent directories or invalid patterns. Note that the tool does not support full regular expressions, only Unix shell-style wildcards.