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. If no directory is specified, it defaults to the current working directory ('.') of the environment where the tool is executed. The tool returns a structured response with two fields: 'error' and 'response'. The 'error' field contains any issues encountered, such as 'No such file or directory', and will reflect the actual file system path where the tool is executed. The 'response' field contains the list of files and directories if the operation is successful. This tool operates within a specific file system context, so users should ensure the paths they provide are accessible within that environment. Example usage: To list contents of a directory, provide the path as 'dir_path'. If the directory does not exist, an error message will be returned. Common errors include 'No such file or directory', indicating the path is invalid or inaccessible.
copy_file:The 'copy_file' tool is designed 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 you wish to copy, and 'destination_path', where you want the copied file to be saved. Both paths must be located within the current working directory; otherwise, an 'Access denied' error will occur. This restriction is in place to ensure security and prevent unauthorized access to other parts of the file system. The tool provides detailed error messages to help diagnose and resolve issues related to permission restrictions and directory access. To successfully perform a copy operation, ensure that both the source and destination paths are correctly set within the allowed directory. The tool does not support copying files across different directories or outside the current working directory.
write_file:The 'write_file' tool allows you to write text to a file on your disk, but it is limited to operating within the current working directory. You can specify the file path, the text content, and whether to append to an existing file or overwrite it. \n- 'file_path' (str): Specifies the name or path of the file where the text will be written. Note: The file path must be within the current working directory.\n- 'text' (str): The content to be written into the file.\n- 'append' (bool, default: false): Determines the writing mode. If set to true, the text will be appended to the file if it exists. If set to false, the file will be overwritten or created if it does not exist.\n\nThe tool provides a response indicating whether the operation was successful or if an error occurred. Common errors include permission issues when attempting to write outside the current working directory, which will be reported in the 'error' field.\n\nExample of a successful operation:\n- Writing to 'output.txt' in the current directory with text 'Hello, World!'\n\nExample of a common error:\n- Attempting to write to '/Users/username/Desktop/file.txt' results in 'Error: Access denied to file_path: /Users/username/Desktop/file.txt. Permission granted exclusively to the current working directory.'
read_file:The read_file tool allows you to read the contents of a specified file from the disk. It requires a single parameter, 'file_path', which must be the exact name of the file located within the current working directory. The tool is limited to accessing files only within this directory. If the specified file cannot be found or accessed, the tool will return an error message, such as 'Error: no such file or directory'. To avoid errors, ensure that the file name is correct, including any special characters, and that the file exists in the current directory. The tool does not provide detailed error messages beyond indicating that the file could not be found or accessed, so careful verification of the file path is necessary.
move_file:The 'move_file' tool enables 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 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.\n\n**Error Handling**: Error messages are returned in the 'response' field. Common errors include 'no such file or directory', indicating the source file does not exist, and 'permission denied', indicating insufficient permissions to move the file. Users should verify the source file's existence and check permissions if these errors occur.\n\n**Preconditions**: Ensure that the source file exists and that you have the necessary permissions to move the file. Also, verify that the destination path is valid and writable.\n\n**Success Response**: A successful operation results in a confirmation message in the 'response' field, such as 'File moved successfully'.\n\n**Example**: To move a file named 'report.docx' from 'C:/Users/John/Documents/Work' to 'C:/Users/John/Documents/Personal', set 'source_path' to 'C:/Users/John/Documents/Work/report.docx' and 'destination_path' to 'C:/Users/John/Documents/Personal/report.docx'.\n\n**Limitations**: Be aware of potential limitations such as maximum path length or unsupported characters in file paths. Ensure the destination path is valid and writable.
file_delete:The 'file_delete' tool enables users to delete a file within the current working directory. To use this tool, users must specify the 'file_path' parameter, which indicates the file to be deleted. Users need appropriate permissions, such as write and delete permissions, to successfully delete the file. If the file does not exist at the specified path, the tool will return an error message: 'Error: no such file or directory'. The tool is restricted to the current working directory and cannot delete files located elsewhere. Common errors include 'access denied' if permissions are insufficient, and 'file not found' if the file does not exist. Ensure the file path is correctly specified, including for hidden files, as incorrect paths will result in a 'no such file or directory' error. Example usage: To delete a file named 'old_report.docx', the user would provide the parameter {'file_path': 'old_report.docx'}.
file_search:The 'file_search' tool enables users to perform a recursive search for files within a specified subdirectory that match a given pattern using Unix shell-style wildcards, also known as globbing. This search is case-sensitive. The tool requires two parameters: 'dir_path', a string indicating the subdirectory to search in (default is the current directory '.'), and 'pattern', a string specifying the search pattern where '*' matches any number of characters and '?' matches a single character. The tool returns a structured response with two fields: 'response' and 'error'. The 'response' field contains either a list of matching files or a message indicating no matches were found. The 'error' field provides diagnostic messages to help troubleshoot issues such as incorrect directory paths or permission problems. Examples of valid patterns include '*.jpg' for all JPEG files or '?.txt' for text files with single-character names. The tool is designed to handle errors gracefully, ensuring users receive clear feedback on their queries.