list_directory:The 'list_directory' tool enables users to programmatically list files and directories within a specified folder. It requires a single parameter, 'dir_path', which is a string indicating the subdirectory to list. If 'dir_path' is not provided, the tool defaults to listing the contents of the current working directory ('.'). The tool returns a list of files and directories in the specified path. If the specified directory does not exist, or if there are permission restrictions on accessing the specified directory, an error message will be returned indicating the issue. Users should ensure they have the necessary permissions to access the specified directories.
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 to the file to be copied, and 'destination_path', which is the path where the copied file will be saved. The tool is restricted to operations within the current working directory, meaning it cannot access or save files outside this directory. Users must ensure that the specified paths are correct and exist within the current working directory. Additionally, users should verify they have the necessary permissions for both the source and destination paths. If the source file does not exist, is incorrectly specified, or there are permission issues, the tool will return an error message indicating the problem, such as 'No such file or directory'. This feedback helps users diagnose and resolve issues related to file access or path correctness. It is important to note that absolute paths or paths outside the current working directory will result in errors.
write_file:The write_file tool enables the creation or modification of text files on disk by writing specified content to a given file path. It is designed for efficient and straightforward text file operations.\n\nParameters:\n- **file_path** (str): The full path where the file will be created or modified. If the file does not exist, it will be created. Note that the tool requires permission to access the specified file path and can only modify files within the current working directory or paths where it has the necessary permissions.\n- **text** (str): The content to be written into the file.\n- **append** (bool): Determines whether the text should be appended to the existing content of the file (if true) or overwrite it (if false). The default behavior is to overwrite.\n\nError Handling: The tool handles errors such as invalid file paths or permission issues by populating the 'error' field in the response. Common errors include 'permission denied' when attempting to access files outside the permitted directory.\n\nExample Usage: To create a new file called 'meeting_notes.txt' and write 'Meeting scheduled for 3 PM on Friday. Agenda includes project updates and budget review.', set 'file_path' to 'meeting_notes.txt', 'text' to the desired content, and 'append' to false. If attempting to write to a file outside the permitted directory, an error message such as 'Error: Access denied to file_path' will be returned.\n\nResponse Details: A successful operation returns a confirmation message in the 'response' field, while any errors encountered will be detailed in the 'error' field.
read_file:The read_file tool reads the contents of a file from disk. It requires the file path as a parameter and is restricted to accessing files within the current working directory. If the specified file does not exist in this directory, the tool will return an error message such as 'Error: no such file or directory'. Attempting to access files outside of this directory will result in an access denied error. The tool is primarily designed for reading text files; attempting to read binary files may not produce meaningful results. To avoid errors, ensure the file is in the correct directory and check for typos in the file name.
move_file:The 'move_file' tool allows you to move or rename a file within your file system. To use this tool, specify the 'source_path' (current file location) and the 'destination_path' (new file location). \n\n**Environment Constraints**: The tool operates exclusively within the current working directory. Both the source and destination paths must be within this directory. \n\n**File Existence Requirement**: The source file must exist for the operation to succeed. If the source file does not exist, the tool will return an error indicating 'no such file or directory'. \n\n**Symbolic Links Handling**: The tool's handling of symbolic links is not explicitly stated, so users should verify if symbolic links are supported or if there are special considerations. \n\n**Error Handling**: Common errors include:\n- 'Access denied': Insufficient permissions to access the source or destination paths.\n- 'Permission granted exclusively to the current working directory': The operation is restricted to the current working directory.\n- 'No such file or directory': The specified source path does not exist.\n\n**Permissions**: Ensure you have the necessary permissions to read from the source path and write to the destination path. \n\n**Troubleshooting**: \n- Verify permissions for both source and destination paths.\n- Confirm the operation is within the current working directory.\n- Check the existence of the source file.\n\n**Examples**: \n- Successful Operation: Moving 'report.pdf' within the current directory.\n- Error Example: Attempting to move a non-existent file results in a 'no such file or directory' error.\n- Error Example: Attempting to move 'vacation.mp4' from 'Downloads' to 'Videos' outside the current directory results in a 'Permission granted exclusively to the current working directory' error.
file_delete:The 'file_delete' tool is designed to remove a specified file from the system. To use this tool, you must provide the 'file_path' parameter, which specifies the path to the file you wish to delete. If the file path does not exist, the tool will return an error message stating 'no such file or directory'. Users must have the necessary permissions to delete the file; otherwise, an error may occur. The tool's behavior may vary across different operating systems, so this should be considered when using it. Upon successful deletion, the tool should return a confirmation message. Note that the tool cannot delete directories or files that are currently in use by another program. Ensure that the file path is correct and that the file is not open in another program, as this can prevent deletion and result in an error message indicating the file does not exist.
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 search includes all subdirectories within the specified directory. Required parameters are 'dir_path', which specifies the subdirectory to search in, and 'pattern', which defines the file name pattern to match. The pattern supports wildcards such as '*', which matches any sequence of characters, '?' for any single character, and '[...]' for any one of the enclosed characters. The tool returns a dictionary with 'error' and 'response' keys. The 'error' key contains any error messages, such as permission issues or invalid directory paths. The 'response' key contains either a list of matching file paths or a message indicating no matches were found. Common use cases include searching for files with specific extensions, prefixes, or patterns in their names. Example responses include: a list of found files, a message indicating no files found, or an error message if the directory is invalid or inaccessible