list_directory:The 'list_directory' tool allows users to list files and directories within a specified subdirectory relative to the current working directory of the tool's execution environment. It requires a single parameter, 'dir_path', which specifies the subdirectory to be listed. If the directory does not exist or is incorrectly specified, the tool will return an error message. This tool operates within a controlled environment and does not have access to the user's local file system. Paths must be specified relative to the tool's environment, and users should ensure that the directory path is correctly specified and exists within the tool's accessible environment to avoid errors. Directory names with spaces should be handled appropriately to prevent errors. Example usage: {'dir_path': 'example_folder'}.
copy_file:The 'copy_file' tool allows users to duplicate a specified file and save it in a designated location 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. Key considerations include: \n1. Current Working Directory Restriction: The tool operates exclusively within the current working directory. Attempting to copy files outside this directory, including symbolic links pointing outside, will result in permission errors. \n2. Overwriting Behavior: If a file with the same name exists at the destination path, it will be overwritten without warning. \n3. Permission Requirements: Users must have the necessary permissions for both the source and destination paths. Errors such as 'Access denied' may occur if permissions are insufficient or if the source file is outside the current working directory. \n4. Symbolic Links: The tool does not follow symbolic links that point outside the current working directory, and attempting to copy such links will result in an 'Access denied' error. \n5. Error Handling: Common errors include 'Access denied' due to permission issues. Users should verify permissions and ensure file paths are within the allowed directory. \nExample usage: To copy a file from '/home/user/documents/report.pdf' to '/home/user/backup/report.pdf', set 'source_path' to '/home/user/documents/report.pdf' and 'destination_path' to '/home/user/backup/report.pdf'. Ensure the destination directory has write permissions.
write_file:The 'write_file' tool enables writing text to a file on disk. It requires the following parameters: 'file_path' (a string specifying the file's path, including directories), 'text' (the content to be written to the file), and 'append' (a boolean indicating whether to append the text to an existing file without overwriting it; defaults to false). If 'append' is false, any existing content in the file will be overwritten. The tool returns a response indicating success or detailing any errors encountered. Note: The tool does not automatically create directories; users must ensure the directory exists before writing. Common errors include syntax issues in the 'text' parameter or invalid file paths. Example usage: To append text to an existing file, set 'append' to true. If the file does not exist, it will be created.
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 only within the current working directory. If the file is outside this directory, does not exist, or if there are permission issues, an error message such as 'Error: no such file or directory' will be returned. The tool returns a response object with 'error' and 'response' fields. There are no optional parameters.
move_file:The 'move_file' tool enables you to move or rename a file or symbolic link within your file system. It requires two parameters: 'source_path', which is the current path of the file or link, and 'destination_path', which is the new path where you want the file or link to be located. The tool operates under specific restrictions: it requires appropriate permissions to access both the source and destination paths and is limited to operating within the current working directory. This means that both the source and destination paths must be within the same directory where the tool is executed. If the source and destination paths are identical, the tool will not perform any operation and may return an error if permissions are restricted. Users must ensure they have the necessary permissions to access and modify the specified paths before using the tool. The tool does not handle errors related to file permissions or directory access, so users must resolve these issues independently. Additionally, the tool does not support moving files or links across different directories outside the current working directory.
file_delete:This tool is designed to delete a specified file from the system using the full file path as a parameter. Key functionalities include:\n\n- **Existence Check**: The tool verifies if the file exists at the specified path before attempting deletion.\n- **Error Handling**: If the file does not exist, the tool returns an error message in a structured JSON format with 'error' and 'response' fields, such as: {'error': '', 'response': 'Error: no such file or directory: [file_path]'}. The tool does not handle cases where the file is open in another program, which may also prevent deletion.\n- **Success Response**: Upon successful deletion, the tool returns a confirmation message indicating the file has been deleted.\n- **Example Usage**: To delete a file located at 'D:/Projects/Secret/confidential_notes.txt', provide the file path as a parameter. Ensure the file path is correct and accessible. An example of an error scenario is when the file does not exist, resulting in an error message.\n- **Platform Limitations**: The tool may have platform-specific limitations, such as differences in file path formats or permission handling across operating systems.\n- **Troubleshooting Tips**: Ensure the file path is accurate, the file is not open in another program, and you have the necessary permissions to delete the file. Check for any permission issues or if the file is being used by another application.\n- **Consistency in Terminology**: The tool consistently uses terms like 'file path' to avoid confusion.\n- **Structured Error Messages**: Error messages are returned in a structured JSON format, which can be useful for developers integrating this tool into larger systems.
file_search:The file_search tool allows users to recursively search for files within a specified subdirectory using Unix shell-style wildcard patterns. It requires two parameters: 'dir_path', which is the subdirectory to search in, and 'pattern', which is the file name pattern to match (e.g., '*.pdf' for all PDF files). The tool returns a list of matching file paths. If no files match the pattern or if the directory is invalid, it returns an error message. The tool does not support full regular expressions and does not verify the existence of the directory before searching. Users should ensure the directory path is correct and accessible, as the tool does not provide detailed error messages.