list_directory:The 'list_directory' tool enables users to view all files and directories within a specified folder. It requires a single parameter, 'dir_path', which is a string indicating the path to the directory you want to list. The default value for 'dir_path' is the current directory ('.'). If the specified directory does not exist, the tool returns an error message in the format: 'Error: [Errno 2] No such file or directory: <specified_path>'. Additionally, if the user lacks permission to access the specified directory, the tool will return an error message indicating access denial, such as: 'Error: Access denied to dir_path: <specified_path>. Permission granted exclusively to the current working directory'. This tool is useful for verifying directory contents, troubleshooting path-related issues, and understanding permission restrictions.
copy_file:The 'copy_file' tool allows users to duplicate a file 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. Both paths must be within the current working directory. The tool will return an error if the source file does not exist, if there are permission issues, or if the destination path does not exist. Users should ensure that the destination directory exists before attempting to copy the file, as the tool does not create directories. Additionally, the tool may not handle paths with special characters correctly, so users should ensure file names are compatible with the underlying file system.
write_file:The write_file tool allows users to write text to a file on disk. Users can specify the 'file_path' to set the file's location and the 'text' to be written. The 'append' parameter determines whether the text should be appended to the existing file content (if set to true) or overwrite it (if set to false, which is the default behavior). The tool provides clear feedback on whether the file was written successfully or if an error occurred. It is designed for plain text files and may not support formats like '.docx'. Users should ensure their input text is properly formatted and escaped to prevent syntax errors. The tool efficiently handles long text inputs, as demonstrated by the successful writing of a lengthy story in the example provided.
read_file:The 'read_file' tool allows you to read the contents of a text file located in the current working directory on disk. It requires a single parameter, 'file_path', which is the name of the file you wish to read. The tool is restricted to accessing files only within the current directory and will return an error message if the specified file does not exist, if there is a typo in the file name, or if the file format is unsupported. The tool supports only text-based file formats and does not support reading binary files such as .xlsx or other non-text formats. Ensure the file is present, the name is correct, and the file format is supported before attempting to read it.
move_file:The 'move_file' tool enables users to move or rename a file from one location to another on their file system. It requires two parameters: 'source_path', the current path of the file to be moved, and 'destination_path', the new path where the file should be placed. The tool attempts to move the file and provides feedback on the operation.\n\nError Handling: The tool returns an error message such as 'no such file or directory' if the source file path is incorrect or if the file does not exist at the specified location. Other potential errors include lack of permissions or issues with the destination directory.\n\nPreconditions: The source file must exist, and the user must have the necessary permissions to access both the source and destination directories.\n\nSuccess Criteria: A successful operation is indicated by the file being present at the destination path and absent from the source path.\n\nLimitations: The tool may have limitations regarding the size of files it can handle, and it may not support symbolic links or certain file types. Users should be aware of potential issues when moving large files.\n\nExamples:\n- Successful move: Moving 'C:/Users/John/Documents/Report.docx' to 'C:/Users/John/Desktop/Work/Report.docx'.\n- Common error: Attempting to move a file that does not exist, resulting in an error message.\n- Permissions error: Attempting to move a file without the necessary permissions, resulting in a permission denied error.
file_delete:This tool deletes a file at the specified absolute file path. Ensure the file exists and that you have the necessary permissions to delete it. If the file does not exist, an error message such as 'Error: no such file or directory' will be returned. If you lack the necessary permissions, an error message such as 'Error: Access denied to file_path' may be returned. The tool may only have permission to delete files within certain directories, such as the current working directory. The tool requires the 'file_path' parameter, which should be a string representing the absolute path to the file you wish to delete.
file_search:The 'file_search' tool enables users to perform a recursive search for files within a specified subdirectory using shell-style wildcard patterns. It requires two parameters: 'dir_path', which defines the subdirectory to search in, and 'pattern', which uses shell-style wildcards (e.g., '*' for any number of characters, '?' for a single character) to match file names. The tool returns an API response containing two fields: 'error', which provides any error messages encountered during the search (such as no files found or the directory not existing), and 'response', which indicates whether any files matching the pattern were found. The search is recursive, meaning it includes all subdirectories within the specified directory.