Read file content. Args: path: Path to file Returns: File content or error message
(path: str)
| 65 | |
| 66 | |
| 67 | def tool_read_file(path: str) -> str: |
| 68 | """ |
| 69 | Read file content. |
| 70 | |
| 71 | Args: |
| 72 | path: Path to file |
| 73 | |
| 74 | Returns: |
| 75 | File content or error message |
| 76 | """ |
| 77 | try: |
| 78 | return _get_fs().read(path) |
| 79 | except FilesystemAccessError as e: |
| 80 | return f"[ERROR] {e}" |
| 81 | |
| 82 | |
| 83 | def tool_write_file(path: str, content: str) -> str: |