list_directory:The 'list_directory' tool allows users to view all 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. This path can be relative or absolute, depending on the system configuration. If the specified directory does not exist, the tool will return an error message, such as 'Error: [Errno 2] No such file or directory'. If the user lacks permission to access the specified directory, the tool will return an 'Access denied' error. These error messages assist users in diagnosing and resolving path-related and permission-related issues. The tool operates within the context of the current working directory, so users should ensure the 'dir_path' is correctly specified relative to this context.
copy_file:The 'copy_file' tool enables users to duplicate a file from a specified source path to a designated destination path, but only within the current working directory. To use this tool, you must provide two parameters: 'source_path', the path of the file you wish to copy, and 'destination_path', where you want the copied file to be saved. The tool is limited to accessing files within the current working directory and will return an error if the source or destination paths are outside this directory. It does not handle permission changes, so users must ensure they have the appropriate access rights to both paths before using the tool. If permission issues arise, the tool will return an error message detailing the access denial. This tool does not support copying files across different directories or managing permission adjustments.
write_file:The 'write_file' tool enables writing plain text to a specified file on disk. It can create new files or overwrite existing ones by default. To append text to an existing file, set the 'append' parameter to true. The tool handles plain text only and does not support format conversions. Upon execution, it returns a success message if the operation is successful, or an error message if issues occur, such as permission errors, invalid file paths, disk space issues, or file system restrictions. The tool efficiently handles large text inputs, making it suitable for saving extensive logs or documents. Users should ensure sufficient disk space and valid file paths before execution. Example usage: To save meeting notes to 'meeting_notes_october.txt', use the parameters: file_path='meeting_notes_october.txt', text='Your text here', append=False. If 'append' is set to false, the file will be overwritten if it already exists.
read_file:The 'read_file' tool allows users to read the contents of a file located in the current working directory. It requires a single parameter, 'file_path', which specifies the name of the file to be read. The tool is restricted to accessing files only within this directory. If a file outside the directory is specified, or if the file does not exist, the tool will return an error message in a structured format with an 'error' field and a 'response' field, such as 'Error: no such file or directory'. The tool cannot read directories, and attempting to do so will result in an error message similar to specifying a non-existent file. Users should ensure the file path is correct and that they have the necessary permissions to access the file. The tool may not provide detailed error messages for permission-related issues. Example usage: To read a file named 'example.txt', set 'file_path' to 'example.txt'. If successful, the tool returns the file's contents as a string.
move_file:The 'move_file' tool enables you to move or rename a file from one location to another on your system. It requires two parameters: 'source_path', the path of the file you wish to move, and 'destination_path', the new path where you want the file to be moved. This tool can also rename files by specifying a different file name in the destination path. Both paths must be valid and accessible, and the destination directory must already exist, as the tool does not create directories. Ensure you have the necessary permissions to read the source file and write to the destination directory. The tool is intended for moving individual files, not directories. Common errors include 'no such file or directory', which can occur if the source file does not exist or if there is a typo in the file path. Before using the tool, verify the existence of the source file and the correctness of both paths. Troubleshooting tips include checking file permissions and ensuring the destination directory exists. Example usage: To move and rename a file from 'D:/Work/Projects/Current/presentation.pptx' to 'D:/Work/Projects/Completed/final_presentation.pptx', ensure both paths are correct and accessible, then execute the move_file operation.
file_delete:The 'file_delete' tool is designed to remove a specified file from the file system. It requires a single parameter, 'file_path', which is a string indicating the path of the file to be deleted. The tool will return an error message if the file path does not exist or if there are insufficient permissions to delete the file, such as 'Error: no such file or directory' or 'Error: Access denied to file_path'. Note that the tool may be restricted to deleting files only within the current working directory unless additional permissions are granted. This tool is compatible with Windows, macOS, and Linux, and users should ensure the file path format is appropriate for the operating system in use. Upon successful deletion, the tool will return a confirmation message. Deleting a file is irreversible, so ensure that you have backups if necessary.
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 wildcards. The tool supports two wildcard characters: '*' which matches any number of characters (including none), and '?' which matches exactly one character. It does not support full regular expressions, so patterns like '[1-5]' will not work. The tool requires two parameters: 'dir_path', which specifies the subdirectory to search in (default is the current directory '.'), and 'pattern', which defines the file pattern to match. The search is recursive, exploring all subdirectories within the specified directory. The tool's output includes an 'error' field for any error messages, such as 'directory not found' or 'invalid pattern', and a 'response' field containing the search results or a message indicating no files were found. If no errors occur, the 'error' field will be empty. Example usage: To find all files starting with 'report_' followed by exactly one character in the 'data' directory, set 'dir_path' to 'data' and 'pattern' to 'report_?.*'. To find all text files in the 'documents' directory, use 'pattern' '*.txt'. Users should ensure the directory path is correct and the pattern is properly formatted to avoid common pitfalls.