# Agentic AI File Tools — Testing Prompts & Reference

This guide lists realistic test prompts for each **file tool** in the Agentic AI platform on **macOS** and **Windows**.

File tools let the agent browse, inspect, search, edit, organize, and archive files inside folders the user has granted for read or write. Paths may be absolute (for example `D:/Projects/...`) or unique relative names found on a data drive (for example `Projects/notes.md`). Profile shortcuts use the same words on macOS and Windows: `desktop`, `documents`, `downloads`, `pictures`, `music`, `movies`, `videos`, `screenshots`, `public`, `shared`, `library`, `applications`, `home`, `recents`, `icloud`, and `onedrive`. Each word resolves to that platform's folder. Never pass `..`. Most tools share path resolution and folder-grant approval through `DesktopFolderTool`.

Copy and paste these prompts into the Agentic chat input to verify tool calling, argument extraction, fuzzy input handling, and folder permission flows.

For a sequential lab script with pass criteria, see [file_tools_test.md](file_tools_test.md). System tools: [agentic-system-tools.md](agentic-system-tools.md). Browser tools: [agentic-browser-tools.md](agentic-browser-tools.md). Process tools: [agentic-process-tools.md](agentic-process-tools.md).

**Status:** Tools marked **Implemented** are registered in `packages/agentic_ai`. Tools marked **Planned** are in this catalog for design and prompt coverage but are not registered yet.

---

## Quick Reference: All 42 File Tools

Aliases share one implementation under another tool name.

| # | Tool ID | Summary | Status |
|---|---|---|---|
| 1 | `search_files` | Find files by name / glob | Implemented |
| 2 | `read_file` | Full text (incl. PDF / Excel extract) | Implemented |
| 3 | `search_file_content` | Exact phrase in one file | Implemented |
| 4 | `search_documents` | Phrase across common text docs | Implemented |
| 5 | `list_directory` | One-level folder listing (or drives) | Implemented |
| 6 | `file_info` | File vs folder + size | Implemented |
| 7 | `write_file` | Create / overwrite any extension | Implemented |
| 8 | `replace_file_content` | Exact string replace in any extension | Implemented |
| 9 | `append_to_file` | Append to any extension (create if missing) | Implemented |
| 10 | `move_file` / `rename_file` | Move or rename | Implemented |
| 11 | `copy_file` / `copy_directory` | Copy file or folder | Implemented |
| 12 | `create_directory` | Create folder (+ parents) | Implemented |
| 13 | `read_file_range` / `read_file_lines` | Line-range slice of a text file | Implemented |
| 14 | `directory_tree` | Nested folder/file tree (≤4 levels) | Implemented |
| 15 | `regex_search_files` | Regex across text files in a folder | Implemented |
| 16 | `extract_archive` | Unpack .zip / .tar / .tar.gz | Implemented |
| 17 | `create_archive` | Pack into .zip | Implemented |
| 18 | `apply_patch` | Apply unified diff (all-or-nothing) | Implemented |
| 19 | `trash_file` | Soft-delete to Bin / Trash | Implemented |
| 20 | `diff_files` | Unified diff of two text files | Implemented |
| 21 | `get_file_metadata` | Type, size, mime, created, modified | Implemented |
| 22 | `get_file_hash` | sha256 / sha1 / md5 of one file | Implemented |
| 23 | `find_duplicate_files` | Duplicate groups by sha256 | Implemented |
| 24 | `read_file_preview` | Short character-capped peek | Implemented |
| 25 | `read_file_encoding` | Detect text encoding | Implemented |
| 26 | `read_image` | Image bytes for the model to see the picture | Planned |
| 27 | `convert_file` | Convert between supported formats | Implemented |
| 28 | `merge_files` | Combine files into one output | Implemented |
| 29 | `split_file` | Split a file into smaller parts | Implemented |
| 30 | `delete_file` | Permanent delete after safety checks | Planned |
| 31 | `restore_file` | Restore from trash or backup | Planned |
| 32 | `open_file` | Open with default desktop app | Planned |
| 33 | `reveal_file_in_explorer` | Show file in Finder / Explorer | Planned |
| 34 | `get_recent_files` | Recently accessed or modified files | Planned |
| 35 | `filter_files` | Filter by extension, size, date, name | Planned |
| 36 | `bulk_rename_files` | Batch rename by pattern | Planned |
| 37 | `bulk_move_files` | Move many files to one destination | Planned |
| 38 | `bulk_copy_files` | Copy many files to one destination | Planned |
| 39 | `compare_file_content` | Meaningful content differences | Implemented |
| 40 | `validate_file` | Readable / structure / format checks | Implemented |
| 41 | `extract_file_metadata` | EXIF / document properties | Implemented |
| 42 | `preview_file` | Visual or rich preview of a file | Planned |

---

## Test Prompts by Tool

---

### 1. `search_files`

**Description:** A filename / glob search over a folder (and its index when available), separate from content search. It answers “do I have a file named X?” without opening file bodies. `query` is required. `*` and `?` are wildcards, so `Gemini_*` matches names that start with `Gemini_`. A backslash escapes the next character, so `\*` is a literal star. Patterns like `*` or `*.ext` return at most 100 matching names. A plain profile folder name (`downloads`, `documents`, `screenshots`) targets that folder. A nested path the user named should be passed in one call. A bare filename such as `testing.txt` searches inside a saved grant folder and is not treated as a folder name. A missing path uses a saved folder only for `*` searches. Use this for discovery by name; use `search_documents` / `search_file_content` / `regex_search_files` when searching inside file text.

* **Direct**:
  * "Search for files named welcome under D:/Projects."
  * "Find all *.pdf files in my Documents folder."
  * "Search Downloads for files matching invoice*."
* **Casual / Conversational**:
  * "do I have anything called report.docx in Documents?"
  * "hunt for screenshot files in my Pictures folder"
* **Fuzzy Logic & Typos (Real User)**:
  * "serch files name welcome in projetcs"
  * "find *.pdff in docuemnts"
* **Vague / Symptom-Based**:
  * "I saved a resume somewhere but forgot the folder — look for resume*."
  * "where's that CSV I named export last week?"

---

### 2. `read_file`

**Description:** The primary full-file reader for the agent. It returns plain text for text/markdown/code, and extracts text from PDF and Excel (`.xlsx`, `.xls`) so the model can answer questions about those formats without a separate viewer. `path` is required. Text files larger than 1 MB are refused—use `read_file_range` for a slice. PDF and Excel larger than 20 MB are refused. Prefer `read_file_preview` when only a quick look is needed, or `read_file_range` when the user asks for specific lines. Paths resolve via absolute or unique data-drive lookup. Read grant required.

* **Direct**:
  * "Read the full text of Documents/notes/welcome.txt."
  * "Open D:/Projects/src/settings.txt and show me its contents."
  * "Extract the text from Documents/report.pdf."
* **Casual / Conversational**:
  * "what's inside welcome.txt?"
  * "read that settings file for me"
  * "pull the text out of this spreadsheet"
* **Fuzzy Logic & Typos (Real User)**:
  * "reed welcme.txt"
  * "opn settings.txt and show contnet"
* **Vague / Symptom-Based**:
  * "I forgot what I wrote in that notes file — show me."
  * "There's a PDF invoice; tell me what it says."

---

### 3. `search_file_content`

**Description:** An exact-phrase search scoped to a **single** text file, with light context around matches. Uses the file index when helpful, but always targets one known path. `path` and `query` are required. Returns at most 10 matching lines with one line of context each. Use when the user already knows the file and asks “does this file contain X?” For folder-wide phrase search use `search_documents`; for patterns use `regex_search_files`. Read grant applies.

* **Direct**:
  * "Search Documents/notes/welcome.txt for the exact phrase \"invoice total\"."
  * "In D:/Projects/src/settings.txt, find the line containing timeout=."
* **Casual / Conversational**:
  * "does welcome.txt mention invoice total?"
  * "look inside settings.txt for the timeout line"
* **Fuzzy Logic & Typos (Real User)**:
  * "serch welcme.txt for invoice totl"
  * "find timeout= inside settigns.txt"
* **Vague / Symptom-Based**:
  * "I know the number is in that notes file somewhere — find invoice."

---

### 4. `search_documents`

**Description:** A multi-file phrase search across common document extensions under a folder: `.txt`, `.md`, `.markdown`, `.csv`, `.json`, and `.log`. Built for “I wrote this somewhere in my notes/project” workflows. `query` is required; optional `path` selects the folder. Returns at most 20 matching lines. Prefer this when the file is unknown but the keywords are known. Not a regex engine—use `regex_search_files` for patterns. Does not search binary formats (PDF/Excel); those need `read_file` after locating by name. Read grant applies.

* **Direct**:
  * "Search documents under D:/Projects for the keywords invoice total."
  * "In my Documents folder, search .md and .txt files for \"morning note\"."
* **Casual / Conversational**:
  * "grep my project docs for invoice total"
  * "search Notes and markdown files for the word timeout"
* **Fuzzy Logic & Typos (Real User)**:
  * "serch docuemnts for invoice totl"
  * "find mornign note in projetcs md files"
* **Vague / Symptom-Based**:
  * "I wrote something about an invoice but forget which file — search the folder."

---

### 5. `list_directory`

**Description:** A non-recursive directory browser for the desktop agent. It returns only the immediate children of a path (files and folder names), so the model can orient itself without dumping an entire drive tree into context. Call this when the user wants to “see what’s in” a folder, compare top-level contents, or discover drives. Pass the folder name, not a parent step: `desktop`, `documents`, `downloads`, `pictures`, `music`, `movies`, `videos`, `screenshots`, `public`, `shared`, `library`, `applications`, `home`, `recents`, `icloud`, `onedrive`. The same names work on macOS and Windows. `movies` and `videos` are the same folder. `recents` lists the Windows Recent folder, or the macOS recent-files list. Never pass `..` or `../Documents`. On Windows, a path of `.` lists drives only, and only when the user asks which drives exist. On macOS, `.` is not a folder: pass the folder name. Do not pass `.`, `Users`, or `home` to look for a named folder. Absolute nested paths (for example `C:/Users/.../Screenshots`) are accepted in one call—the tool does not walk the user profile on the way there. Relative names like `projects` are resolved on a data drive via the shared path lookup. Requires a folder read grant when targeting a specific folder.

* **Direct**:
  * "What is in my desktop folder?"
  * "List one level of my Documents folder."
  * "Show the contents of D:/Projects. Do not recurse."
  * "List the top-level folders on each drive."
* **Casual / Conversational**:
  * "what's sitting in my downloads right now?"
  * "can you peek inside my Projects folder for me?"
  * "show me what's in documents, just the first level"
* **Fuzzy Logic & Typos (Real User)**:
  * "lst dir of downlaods"
  * "show filez in docuemnts"
  * "wat folders r in D:/Projects"
* **Vague / Symptom-Based**:
  * "I think I dropped something in Downloads yesterday — what's in there?"
  * "I can't find my project folder on this PC; show me the top of each drive."

---

### 6. `file_info`

**Description:** A lightweight existence / kind check. It tells the agent whether a path is a file or a folder and reports size, without loading contents. Use before risky writes, before copy/move, or when the user asks “is this a file?” / “how big is it?” Path is required and resolved through the shared absolute / data-drive lookup. It does not return body text, mime type, or timestamps—those belong to `get_file_metadata` and the read tools. Read grant covers the parent folder of the path.

* **Direct**:
  * "Get file info for D:/Projects/notes/welcome.txt. Do not read its contents."
  * "Is Downloads/report.pdf a file or a folder, and how large is it?"
* **Casual / Conversational**:
  * "quick check — is that path a file and how big is it?"
  * "tell me the size of my notes.md without opening it"
* **Fuzzy Logic & Typos (Real User)**:
  * "file info for welcme.txt"
  * "is this a foldr or file and size?"
* **Vague / Symptom-Based**:
  * "This path feels wrong — confirm what it is and how large without reading it."

---

### 7. `write_file`

**Description:** A create-or-replace writer. The extension in `path` is kept, including source files such as `.py`. Existing files at the path are replaced entirely. Content is written as text. `path` and `content` are required. Include the folder in the path (for example `Downloads/testing.txt` or `Projects/.../notes.md`). Absolute drive paths stay on that drive; relative unique names resolve on a data drive. Triggers folder write approval the first time a new folder is used. For adding lines without wiping the file, use `append_to_file`; for surgical edits use `replace_file_content` or `apply_patch`.

* **Direct**:
  * "Create Documents/notes/extra.md with exactly two lines: Extra note / Created by write_file."
  * "Write D:/Projects/notes/todo.txt containing: Buy milk."
* **Casual / Conversational**:
  * "make a new markdown note called extra.md in my notes folder"
  * "save this text into a file called scratch.txt in Downloads"
* **Fuzzy Logic & Typos (Real User)**:
  * "writ file notes/extra.md with hello world"
  * "creeate todo.txt in projetcs"
* **Vague / Symptom-Based**:
  * "I need a place to dump this paragraph — put it in a new md file under notes."

---

### 8. `replace_file_content`

**Description:** An exact-string surgical editor. The extension in `path` is kept. Changes only the `old` → `new` match the user (or model) specifies; other lines stay intact. `path`, `old`, and `new` are required. Best when one unambiguous substring exists (for example a single `timeout=30` line). If the string is missing or appears many times unexpectedly, the edit may fail or need a more specific `old` value. Write grant required. For multi-hunk structured edits, use `apply_patch`.

* **Direct**:
  * "In D:/Projects/src/settings.txt, replace the exact text timeout=30 with timeout=60. Do not change any other line."
  * "In Documents/notes/welcome.txt, replace \"invoice total is 42\" with \"invoice total is 50\"."
* **Casual / Conversational**:
  * "bump the timeout in settings.txt from 30 to 60"
  * "fix that one phrase in welcome.txt for me"
* **Fuzzy Logic & Typos (Real User)**:
  * "replce timeout=30 with timeout=60 in settigns.txt"
  * "chage invoice total is 42 to 50"
* **Vague / Symptom-Based**:
  * "The config still has the old timeout — update only that value."

---

### 9. `append_to_file`

**Description:** An append-only writer. The extension in `path` is kept. Preserves existing content and creates the file when it does not exist—safe for journals, logs, and running todo lists. Content is written as text. `path` and `content` are required. Paths resolve like other write tools (absolute or data-drive lookup). Write grant required. Prefer over `write_file` whenever the user says “add to the end” / “don’t overwrite.”

* **Direct**:
  * "Append this line to Documents/notes/journal.md without rewriting existing lines: Appended lab line."
  * "Add \"Done.\" to the end of D:/Projects/notes/todo.txt."
* **Casual / Conversational**:
  * "tack another line onto my journal"
  * "append a quick note at the bottom of todo.txt"
* **Fuzzy Logic & Typos (Real User)**:
  * "apend to jurnal.md: hello again"
  * "add line to todo.txt witout overwrite"
* **Vague / Symptom-Based**:
  * "Don't wipe my journal — just add today's line at the end."

---

### 10. `move_file` / `rename_file`

**Description:** A move/rename tool for files and folders. Same class powers both `move_file` and `rename_file`—rename is just a move within the same parent with a new name. Destination must not already exist. `source` and `destination` are required. Use to reorganize projects, rename confusing backups, or relocate into a new subfolder (create the folder first with `create_directory` if needed). Contents are unchanged; only the path changes. Write grant required.

* **Direct**:
  * "Rename Documents/archive/welcome_backup.txt to Documents/archive/welcome_renamed.txt."
  * "Move D:/Projects/archive/welcome_renamed.txt to D:/Projects/archive/stored/welcome_renamed.txt."
* **Casual / Conversational**:
  * "rename that backup file to welcome_renamed.txt"
  * "move the renamed file into a stored subfolder"
* **Fuzzy Logic & Typos (Real User)**:
  * "renam welcme_backup.txt to welcme_renamed.txt"
  * "mov file into archive/stored/"
* **Vague / Symptom-Based**:
  * "This backup name is confusing — rename it, then put it in a stored folder."

---

### 11. `copy_file` / `copy_directory`

**Description:** A safe copy for files **or** folders. One implementation registered as both `copy_file` and `copy_directory`. Destination must not already exist—no silent overwrite. `source` and `destination` are required. Use for backups before edits, duplicating a notes tree, or staging files into an archive folder. Folder copies include nested contents. Write grant covers the destination parent; read grant may apply to the source. After a successful copy, `find_duplicate_files` can verify content sameness.

* **Direct**:
  * "Copy Documents/notes/welcome.txt to Documents/archive/welcome_backup.txt. Do not overwrite."
  * "Copy the folder D:/Projects/notes to D:/Projects/archive/notes_copy, including every file inside."
* **Casual / Conversational**:
  * "duplicate welcome.txt into the archive folder as a backup"
  * "copy my whole notes folder into archive"
* **Fuzzy Logic & Typos (Real User)**:
  * "cpy welcme.txt to archive/welcme_backup.txt"
  * "copy_directory notes to archive/notes_cpy"
* **Vague / Symptom-Based**:
  * "I want a backup before I edit — copy the file somewhere safe."

---

### 12. `create_directory`

**Description:** A folder creator that also makes missing parents when they are not restricted system paths. Aliased as `make_directory` for natural phrasing. `path` is required. Relative unique paths (for example `Projects/agent-tool-check`) are created on a data drive; absolute paths stay on the named drive. Use before writing files into a new location, or when the user asks to “set up” a folder for archives, drafts, or labs. Write grant required for the destination parent.

* **Direct**:
  * "Create the folder D:/Projects/archive, including parents if needed."
  * "Make a directory Documents/notes/archive."
* **Casual / Conversational**:
  * "set up an archive folder inside my Projects"
  * "I need a new folder called drafts under Documents"
* **Fuzzy Logic & Typos (Real User)**:
  * "creeate dir projetcs/archive"
  * "make_directory docuemnts/drafts"
* **Vague / Symptom-Based**:
  * "I need somewhere to stash old files — make an archive folder in Projects."

---

### 13. `read_file_range` / `read_file_lines`

**Description:** A line-window reader for large or partially relevant text files. Registered as both `read_file_range` and `read_file_lines` so natural language either way hits the same tool. `path` is required. `start` is the first line (counting from 1); `count` is how many lines to return. Use when the full file would blow context limits, when the user names line numbers, or after `read_file` was refused for size. Does not apply to binary/PDF extract the way `read_file` does—it targets text slices. Read grant applies.

* **Direct**:
  * "Read only lines 2 through 3 of Documents/notes/welcome.txt."
  * "From D:/Projects/src/settings.txt, return the first 2 lines only."
* **Casual / Conversational**:
  * "just give me the middle of welcome.txt, like lines 2–3"
  * "skip the header — show lines 2 to 4 of that file"
* **Fuzzy Logic & Typos (Real User)**:
  * "reed lines 2-3 of welcme.txt"
  * "file range start 1 count 2 for settigns.txt"
* **Vague / Symptom-Based**:
  * "The file is huge; I only need a couple of lines near the top."

---

### 14. `directory_tree`

**Description:** A compact nested tree view of a folder hierarchy. Use when the user needs structure—how a project is laid out, what sits under nested folders—not just a flat listing. The tree includes folder names and files, capped around four levels deep so responses stay usable. Optional `path` selects the root; omit or resolve via the usual absolute / data-drive lookup. Prefer this over repeated `list_directory` calls when depth matters. Read grant applies to the chosen folder.

* **Direct**:
  * "Show a directory tree of D:/Projects with max depth 3, including files."
  * "Give me a folder tree of my Documents folder."
* **Casual / Conversational**:
  * "map out the structure of my Projects folder"
  * "how is my Documents folder laid out?"
* **Fuzzy Logic & Typos (Real User)**:
  * "dir tree of D:/Projecdts"
  * "foldr tree for docuemnts pls"
* **Vague / Symptom-Based**:
  * "I'm lost in my Projects folder — show me how it's organized."

---

### 15. `regex_search_files`

**Description:** A folder-scoped regular-expression content search. Finds structured patterns (numbers, keys, emails) across text files. `pattern` is required; optional `path` selects the folder. Returns at most 20 matches. Use when exact phrase search is too rigid (for example `timeout=\d+`). Keep patterns precise to avoid noisy results. Read grant applies.

* **Direct**:
  * "Search D:/Projects for the regex pattern timeout=\\d+ in .txt files only."
  * "Run a regex search under Documents for email-like patterns."
* **Casual / Conversational**:
  * "grep Projects for timeout followed by digits"
  * "regex-search my notes for lines that look like key=value"
* **Fuzzy Logic & Typos (Real User)**:
  * "regex serch projetcs timeout=\\d+"
  * "grep for retries=\\d+ in settigns"
* **Vague / Symptom-Based**:
  * "I need every place a timeout number is set in the project text files."

---

### 16. `extract_archive`

**Description:** An archive extractor for `.zip`, `.tar`, and `.tar.gz`. `path` is required (the archive). Optional `destination` selects the output folder; otherwise a sensible default next to the archive is used. Use after receiving a zip/tar, or after `create_archive` in a round-trip test. Write grant for the destination; read for the archive path.

* **Direct**:
  * "Extract Documents/archive/notes.zip into Documents/archive/unpacked."
  * "Unzip D:/Projects/archive/src.zip to D:/Projects/archive/src_out."
* **Casual / Conversational**:
  * "unpack that notes zip into an unpacked folder"
  * "untar this archive into archive/out"
* **Fuzzy Logic & Typos (Real User)**:
  * "unzp notes.zip into archive/unpacked"
  * "extrct archive src.zip pls"
* **Vague / Symptom-Based**:
  * "I got a zip back — pull the files out next to it."

---

### 17. `create_archive`

**Description:** A zip packer for a file or folder. Output path must not already exist. `path` is the file or folder to pack; optional `output` sets the `.zip` destination. Use for sharing a notes tree, shipping a project slice, or making a portable backup. Relative paths inside the zip follow the source layout. Write grant for the output location; read for the source.

* **Direct**:
  * "Zip the folder Documents/notes into Documents/archive/notes.zip."
  * "Compress D:/Projects/src into D:/Projects/archive/src.zip."
* **Casual / Conversational**:
  * "zip up my notes folder for backup"
  * "make a zip of the src directory"
* **Fuzzy Logic & Typos (Real User)**:
  * "zip notes into archive/notes.zip"
  * "compres archive of projetcs/src"
* **Vague / Symptom-Based**:
  * "I need to send the notes folder to someone — pack it into a zip."

---

### 18. `apply_patch`

**Description:** A unified-diff applier for one or more text files. Accepts standard `---` / `+++` / `@@` hunks and refuses the whole write if any hunk fails to match—preventing half-applied edits. Argument `patch` carries the diff. Paths inside the patch are absolute or unique data-drive paths. Use for multi-line or multi-file changes where exact context matters. If context is stale, nothing is written—re-read the file, regenerate the patch, retry. Write grant required for affected folders.

* **Direct**:
  * "Apply this unified diff to D:/Projects/src/settings.txt. If it does not match, change nothing:"

```text
--- a/D:/Projects/src/settings.txt
+++ b/D:/Projects/src/settings.txt
@@ -1,4 +1,4 @@
 name=lab
 timeout=60
-retries=3
+retries=5
 mode=safe
```

* **Casual / Conversational**:
  * "here's a patch for settings.txt — apply it carefully"
  * "use this unified diff to bump retries to 5"
* **Fuzzy Logic & Typos (Real User)**:
  * "aplly patch to settigns.txt for retries"
  * "unifed diff apply pls, fail if mismatch"
* **Vague / Symptom-Based**:
  * "I have a small fix as a diff; apply it only if the context still matches."

---

### 19. `trash_file`

**Description:** A recoverable soft-delete that sends a file or folder to the Recycle Bin on Windows or the Trash on macOS. Unlike a hard delete, the user can restore the item. Every call sets `confirmsEveryCall = true` and shows a permission card with name and size before the move. `path` is required. Prefer this whenever the user says delete but may want the file back. Do not use it for permanent wipe semantics—the OS trash handles recovery. Run late in test scripts so lab fixtures remain available until then. Write/trash confirmation is always interactive.

* **Direct**:
  * "Move Documents/notes/extra.md to the Recycle Bin or Trash."
  * "Trash D:/Projects/archive/temp.txt."
* **Casual / Conversational**:
  * "throw extra.md in the trash"
  * "delete that temp file the recoverable way"
* **Fuzzy Logic & Typos (Real User)**:
  * "trsh extra.md"
  * "send temp.txt to recyle bin"
* **Vague / Symptom-Based**:
  * "I don't need extra.md anymore, but I might want it back — soft-delete it."

---

### 20. `diff_files`

**Description:** A two-file text comparer that returns a unified diff (`+` / `-` lines). Lets the agent explain what changed between versions without rewriting either file. `pathA` and `pathB` are required (absolute or unique data-drive paths). Use after edits, to compare backup vs current, or before applying a patch. Read-only—pairing with `replace_file_content` or `apply_patch` is a separate write step. Read grant covers both paths.

* **Direct**:
  * "Compare D:/Projects/src/settings.txt with D:/Projects/src/settings_old.txt and show a unified diff."
  * "Diff Documents/notes/a.md against Documents/notes/b.md."
* **Casual / Conversational**:
  * "what's different between settings.txt and settings_old.txt?"
  * "show me the changes between these two note files"
* **Fuzzy Logic & Typos (Real User)**:
  * "dif settigns.txt vs settigns_old.txt"
  * "unifed diff of a.md and b.md"
* **Vague / Symptom-Based**:
  * "I think I edited the timeout — prove what changed between the old and new settings."

---

### 21. `get_file_metadata`

**Description:** A richer metadata probe than `file_info`. It returns type, size in bytes, creation time, last modified time, and mime type so the agent can reason about freshness and format without reading the body. Path is required. Use when the user cares about “when was this changed?”, mime type, or byte size for planning (download integrity, whether to open a PDF, age of a config). Still does not return file contents—pair with `read_file` or `read_file_preview` if the body is needed. Read grant applies.

* **Direct**:
  * "Get file metadata for Documents/notes/welcome.txt: kind, size, mime, created, modified."
  * "Show metadata for D:/Projects/src/settings.txt without reading the file."
* **Casual / Conversational**:
  * "when was this file last changed, and what's its mime type?"
  * "give me the stats on that PDF — size and dates"
* **Fuzzy Logic & Typos (Real User)**:
  * "file metadta for welcme.txt"
  * "mime + size + modifed time pls"
* **Vague / Symptom-Based**:
  * "I need to know if this file is old before I trust it — give me dates and type."

---

### 22. `get_file_hash`

**Description:** A checksum tool for one file. Supports `sha256`, `sha1`, and `md5` so the agent can verify downloads, compare copies, or support duplicate workflows without comparing full contents in chat. Both `path` and `algorithm` are required. Use for integrity checks (“was this corrupted?”), comparing two paths after a copy, or preparing evidence before `find_duplicate_files`. Does not modify the file. Read grant applies to the file’s folder.

* **Direct**:
  * "Calculate the sha256 hash of Documents/notes/welcome.txt."
  * "Get the md5 of D:/Projects/archive/notes.zip."
* **Casual / Conversational**:
  * "checksum this file with sha256 so I can compare it later"
  * "hash my welcome.txt with sha1"
* **Fuzzy Logic & Typos (Real User)**:
  * "sha256 has of welcme.txt"
  * "md5 cheksum for notes.zip"
* **Vague / Symptom-Based**:
  * "I want to confirm this download wasn't corrupted — give me a hash."

---

### 23. `find_duplicate_files`

**Description:** A folder-wide duplicate finder that groups files with the same sha256 content hash. It answers “what am I storing twice?” without the user manually hashing each file. `path` is required and must be a directory. The tool walks under that folder, hashes files, and returns duplicate groups. It never changes or deletes files—cleanup (trash/move) is a separate user-approved step. Use after copies or when the user complains about disk space from duplicate backups. Read grant covers the scanned folder.

* **Direct**:
  * "Find duplicate files under D:/Projects. Do not change any file."
  * "Scan Documents for duplicate files by hash."
* **Casual / Conversational**:
  * "do I have the same file saved twice in Projects?"
  * "clean-up help — show me duplicate copies under Downloads"
* **Fuzzy Logic & Typos (Real User)**:
  * "find dulpicate files in projetcs"
  * "dupes under docuemnts pls"
* **Vague / Symptom-Based**:
  * "My disk is full of copies of the same thing — show me the duplicates."

---

### 24. `read_file_preview`

**Description:** A character-capped peek that loads only the start of a file. Built for “is this the right file?” checks without pulling the whole body into the model. `path` and `maxCharacters` are required; `maxCharacters` must be between 1 and 4000. The result indicates whether the preview was truncated. Prefer this over `read_file` for quick identification, and over `read_file_range` when the user thinks in characters rather than line numbers. Read grant applies.

* **Direct**:
  * "Read a preview of Documents/notes/welcome.txt with at most 40 characters."
  * "Preview D:/Projects/notes/journal.md, max 100 characters."
* **Casual / Conversational**:
  * "give me a quick peek at welcome.txt, not the whole thing"
  * "skim the start of journal.md"
* **Fuzzy Logic & Typos (Real User)**:
  * "previe welcme.txt 20 chars"
  * "quick peek journal.md maxChars 50"
* **Vague / Symptom-Based**:
  * "Is this the right notes file? Show me just the beginning."

---

### 25. `read_file_encoding`

**Description:** An encoding detector that inspects the start of a file and reports the text encoding (for example utf-8). It does not return the file body. Path is required. Use when characters look garbled, before editing in an external editor, or when the agent needs to know how to interpret a file. Complements `read_file` / write tools but does not itself rewrite encoding. Read grant applies.

* **Direct**:
  * "Detect the text encoding of Documents/notes/welcome.txt. Do not return the body."
  * "What encoding is D:/Projects/src/settings.txt using?"
* **Casual / Conversational**:
  * "is this file utf-8 or something else?"
  * "check the encoding before I open it in an editor"
* **Fuzzy Logic & Typos (Real User)**:
  * "encodng of welcme.txt"
  * "is settigns.txt utf8?"
* **Vague / Symptom-Based**:
  * "Characters look garbled in my editor — what encoding is the file?"

---

### 26. `read_image` *(Planned)*

**Description:** Posts image file bytes to the model so it can see the picture (vision), not just metadata or a text path. Path is required and should point at a supported image (for example PNG, JPEG, WebP, GIF). Use when the user asks what is in a screenshot, photo, or diagram, or when layout/color matters more than filenames. Distinct from `read_file` (text/PDF/Excel extract), `read_file_preview` (text peek), `preview_file` (UI thumbnail/rich preview), and `extract_file_metadata` (EXIF without sending pixels to the model). Read grant applies; large images may be resized or refused by size limits when implemented.

* **Direct**:
  * "Read the image Documents/photos/trip.jpg so you can see what is in it."
  * "Post the bytes for D:/Projects/designs/mockup.png and describe the UI."
* **Casual / Conversational**:
  * "look at this screenshot and tell me what it shows"
  * "open the photo and describe it"
* **Fuzzy Logic & Typos (Real User)**:
  * "reed image trip.jpg"
  * "show pictre mockup.png to the model"
* **Vague / Symptom-Based**:
  * "I can't explain the bug in words — look at the screenshot."

---

### 27. `convert_file`

**Description:** A format-conversion tool for supported office and data files (for example DOCX → PDF, CSV → XLSX). The agent picks an input path, target format, and output location so the user gets a usable file in the format a downstream app or recipient expects. Conversion should refuse unsupported pairs and avoid overwriting without a clear destination. Write grant for the output folder; read for the source. Prefer this when the user needs a different container or mime type, not when they only need extracted text (`read_file`).

* **Direct**:
  * "Convert Documents/report.docx to PDF in the same folder."
  * "Convert D:/Projects/data/export.csv to XLSX."
* **Casual / Conversational**:
  * "turn this Word doc into a PDF for me"
  * "make an Excel file from that CSV"
* **Fuzzy Logic & Typos (Real User)**:
  * "conver report.docx to pdf"
  * "csv to xlsx pls for export.csv"
* **Vague / Symptom-Based**:
  * "I need to share this Word file but they only take PDF."

---

### 28. `merge_files`

**Description:** Combines two or more supported files into a single output (for example concatenating markdown notes or merging PDFs). Built for “chapters in separate files” and “stitch these reports” workflows. Inputs and output path are required; order of inputs should be preserved. Destination must not silently clobber an existing file unless the user asks to replace. Distinct from `append_to_file` (one file, text append) and from `create_archive` (packaging without merging content). Write grant for the output; read for each source.

* **Direct**:
  * "Merge Documents/notes/part1.md and Documents/notes/part2.md into Documents/notes/combined.md."
  * "Combine D:/Projects/reports/a.pdf and D:/Projects/reports/b.pdf into one PDF."
* **Casual / Conversational**:
  * "stitch these two markdown notes into one file"
  * "merge those PDFs into a single document"
* **Fuzzy Logic & Typos (Real User)**:
  * "merg part1.md and part2.md"
  * "combine pdfs a and b into one"
* **Vague / Symptom-Based**:
  * "I have chapters in separate files — put them all into one."

---

### 29. `split_file`

**Description:** Splits a large supported file into smaller files or sections (by line count, row count, page count, or size). Useful when a file is too large for email, upload limits, or context windows. Source path, split rule, and destination folder are required; naming of chunks should be predictable (for example `big_001.md`). Inverse of `merge_files`. Does not replace `read_file_range`, which only returns a slice to the model without writing new files. Write grant for the output folder; read for the source.

* **Direct**:
  * "Split Documents/notes/big.md into files of 100 lines each under Documents/notes/chunks."
  * "Split D:/Projects/data/large.csv into separate CSVs of 1000 rows."
* **Casual / Conversational**:
  * "break this huge markdown into smaller pieces"
  * "chop the CSV into batches"
* **Fuzzy Logic & Typos (Real User)**:
  * "splt big.md into smaller files"
  * "split large.csv every 1000 rows"
* **Vague / Symptom-Based**:
  * "This file is too big to email — split it into smaller parts."

---

### 30. `delete_file` *(Planned)*

**Description:** Permanently removes a file after explicit permission and safety checks. Unlike `trash_file`, the item is not recoverable from Recycle Bin / Trash. Always confirm with the user (or a dedicated confirmation card) before executing. Prefer `trash_file` when the user might want the file back; use `delete_file` only for intentional hard deletes (secrets, temp junk, compliance wipe). Path is required. Write / destructive grant required.

* **Direct**:
  * "Permanently delete Documents/archive/temp.txt after confirming. Do not use Trash."
  * "Hard-delete D:/Projects/scratch/old_draft.md with safety checks."
* **Casual / Conversational**:
  * "wipe that temp file for good, not just trash"
  * "permanently remove the old draft"
* **Fuzzy Logic & Typos (Real User)**:
  * "perma delete temp.txt"
  * "hard del old_draft.md"
* **Vague / Symptom-Based**:
  * "I don't want this recoverable — delete it for real."

---

### 31. `restore_file` *(Planned)*

**Description:** Restores a previously trashed file (or a file from a supported backup) back to a usable path. Companion to `trash_file`. The agent may need the original name, trash entry id, or backup location. Destination should not overwrite an existing file without confirmation. Use when the user undoes a soft-delete or recovers from a known backup snapshot. Write grant for the restore destination.

* **Direct**:
  * "Restore Documents/notes/extra.md from the Recycle Bin or Trash."
  * "Restore the last trashed file named welcome_backup.txt."
* **Casual / Conversational**:
  * "bring back that file I just trashed"
  * "undelete extra.md from trash"
* **Fuzzy Logic & Typos (Real User)**:
  * "restror extra.md from trash"
  * "undelet welcme_backup.txt"
* **Vague / Symptom-Based**:
  * "I deleted something by mistake — get it back if it's still in Trash."

---

### 32. `open_file` *(Planned)*

**Description:** Launches a file in its associated desktop application (default handler for that extension). The agent does not read the body into chat—it hands the path to the OS so the user can view or edit natively. Path is required. Distinct from `read_file` (content into the model) and from `reveal_file_in_explorer` (show in file manager). Useful when the user wants Word, Preview, Excel, or another app, not a text dump.

* **Direct**:
  * "Open Documents/notes/welcome.txt with the default app."
  * "Open D:/Projects/reports/summary.pdf in the system PDF viewer."
* **Casual / Conversational**:
  * "open that PDF for me on the desktop"
  * "launch welcome.txt in my usual editor"
* **Fuzzy Logic & Typos (Real User)**:
  * "opn welcme.txt with defalt app"
  * "open sumary.pdf pls"
* **Vague / Symptom-Based**:
  * "I want to look at this in the normal app, not just in chat."

---

### 33. `reveal_file_in_explorer` *(Planned)*

**Description:** Opens the containing folder in Finder (macOS) or File Explorer (Windows) and highlights the selected file. Helps when the user knows a path from chat but cannot locate it in the UI. Path is required. Does not open the file itself—use `open_file` for that. Read grant may apply to confirm the path exists before revealing.

* **Direct**:
  * "Reveal Documents/notes/welcome.txt in Finder or File Explorer."
  * "Show D:/Projects/src/settings.txt in the file manager and select it."
* **Casual / Conversational**:
  * "show me where this file lives in Explorer"
  * "open the folder and highlight welcome.txt"
* **Fuzzy Logic & Typos (Real User)**:
  * "reveal welcme.txt in exploror"
  * "show in finder settigns.txt"
* **Vague / Symptom-Based**:
  * "I know the file exists but I can't find the folder in the UI."

---

### 34. `get_recent_files` *(Planned)*

**Description:** Lists recently accessed or recently modified files from supported locations (profile folders, granted roots, or OS recent lists where available). Answers “what was I working on?” when the user forgot the name. Optional filters: location, limit, access vs modified. Distinct from `search_files` (name match) and `filter_files` (arbitrary metadata rules). Read grant for scanned folders.

* **Direct**:
  * "List the 20 most recently modified files in Documents."
  * "Show recently accessed files under D:/Projects."
* **Casual / Conversational**:
  * "what did I touch last in Documents?"
  * "show my recent project files"
* **Fuzzy Logic & Typos (Real User)**:
  * "recnt files in docuemnts"
  * "last modifed files in projetcs"
* **Vague / Symptom-Based**:
  * "I worked on something earlier today and forgot the name — show recent files."

---

### 35. `filter_files` *(Planned)*

**Description:** Filters files under a folder by extension, size, date, name pattern, or other metadata fields, then returns the matching set. Built for cleanup and triage (“large PDFs from this week”) without opening contents. Path / scope plus filter criteria are required. Complements `search_files` (name/glob focus) and `get_recent_files` (recency-only). Read grant covers the scanned folder.

* **Direct**:
  * "In Documents, filter for *.pdf larger than 5 MB modified in the last 7 days."
  * "Under D:/Projects, list .txt files smaller than 10 KB whose name contains settings."
* **Casual / Conversational**:
  * "show me big PDFs from this week in Documents"
  * "filter Projects for tiny settings text files"
* **Fuzzy Logic & Typos (Real User)**:
  * "filtr pdfs >5mb last week"
  * "filter *.txt name settigns"
* **Vague / Symptom-Based**:
  * "Downloads is a mess — only show large PDFs from the past few days."

---

### 36. `bulk_rename_files` *(Planned)*

**Description:** Renames many files in one operation using a pattern or rule (prefix/suffix, sequential numbers, find/replace in names). Scoped to a folder or an explicit file list. Destination names must not collide; dry-run or confirmation is recommended before applying. Prefer single `rename_file` for one path. Write grant required for the folder.

* **Direct**:
  * "In Documents/photos, bulk rename *.jpg to trip_2024_001.jpg, trip_2024_002.jpg, and so on."
  * "Under D:/Projects/exports, rename all report_*.csv by replacing report_ with final_."
* **Casual / Conversational**:
  * "batch rename these photos with a trip prefix and numbers"
  * "rename all those report CSVs to start with final_"
* **Fuzzy Logic & Typos (Real User)**:
  * "bulk renam jpgs trip_2024_##"
  * "renam all report_*.csv to final_*.csv"
* **Vague / Symptom-Based**:
  * "These photo names are random — give them a consistent numbered pattern."

---

### 37. `bulk_move_files` *(Planned)*

**Description:** Moves multiple selected files (or a filtered set) into one destination directory in a single operation. Destination must exist or be creatable; name collisions should fail or ask, not overwrite silently. Prefer `move_file` for one item. Use after `filter_files` when the user wants “take all these and put them there.” Write grant for destination; read for sources.

* **Direct**:
  * "Move all *.log files from D:/Projects/logs into D:/Projects/archive/logs."
  * "Bulk move Documents/inbox/*.pdf to Documents/invoices."
* **Casual / Conversational**:
  * "move all these logs into the archive folder"
  * "take every PDF in inbox and put them in invoices"
* **Fuzzy Logic & Typos (Real User)**:
  * "bulk mov *.log to archive/logs"
  * "move all pdfs from inbox to invioces"
* **Vague / Symptom-Based**:
  * "Inbox is full of PDFs — park them all in invoices."

---

### 38. `bulk_copy_files` *(Planned)*

**Description:** Copies multiple selected files into a destination directory without removing the originals. Same collision rules as bulk move—no silent overwrite. Prefer `copy_file` for a single path or folder tree. Useful for backup-before-reorganize workflows. Write grant for destination; read for sources.

* **Direct**:
  * "Copy all *.md files from Documents/notes to Documents/backup/notes."
  * "Bulk copy D:/Projects/src/*.txt into D:/Projects/archive/txt_backup."
* **Casual / Conversational**:
  * "copy all my markdown notes into the backup folder"
  * "duplicate those txt files into archive"
* **Fuzzy Logic & Typos (Real User)**:
  * "bulk cpy *.md to backup/notes"
  * "copy all txts into archive/txt_backup"
* **Vague / Symptom-Based**:
  * "I want a safety copy of every note before I reorganize."

---

### 39. `compare_file_content`

**Description:** Compares two files and surfaces **meaningful** differences—semantic or summarized changes—rather than only a raw unified diff. Complements `diff_files` (line-oriented `+`/`-` output). Use when the user wants “what actually matters?” between versions (settings drift, note edits) without a full patch dump. Paths for both files are required. Read-only; grants cover both parents.

* **Direct**:
  * "Compare Documents/notes/a.md and Documents/notes/b.md and summarize meaningful differences."
  * "Compare D:/Projects/src/settings.txt with settings_old.txt and highlight important changes only."
* **Casual / Conversational**:
  * "are these two notes basically the same or what changed that matters?"
  * "tell me the important diffs between old and new settings"
* **Fuzzy Logic & Typos (Real User)**:
  * "compare contnet of a.md vs b.md"
  * "meanigful diff settigns vs settigns_old"
* **Vague / Symptom-Based**:
  * "I don't need a raw diff dump — what actually matters between these two files?"

---

### 40. `validate_file`

**Description:** Checks whether a file is readable, structurally valid, and matches an expected format (for example valid CSV, parseable JSON, intact PDF header). Returns pass/fail with concrete errors so the agent can diagnose importer failures. Path and expected format (or auto-detect from extension) are required. Does not rewrite the file—pair with convert/repair tools later if added. Read grant applies.

* **Direct**:
  * "Validate that Documents/data/export.csv is readable and a valid CSV."
  * "Check whether D:/Projects/config/app.json is valid JSON."
* **Casual / Conversational**:
  * "is this CSV actually valid or corrupted?"
  * "check if app.json parses cleanly"
* **Fuzzy Logic & Typos (Real User)**:
  * "validte export.csv"
  * "is app.josn valid?"
* **Vague / Symptom-Based**:
  * "My importer keeps failing — is the file broken or the wrong format?"

---

### 41. `extract_file_metadata`

**Description:** Pulls embedded metadata beyond basic filesystem stats—document properties (author, title), image EXIF (camera, GPS, capture time), and other format-specific tags. Distinct from `get_file_metadata` / `file_info`, which cover size, mime, and OS timestamps. Path is required. Use for photo forensics, document provenance, or “when was this shot?” Read grant applies; no body dump unless the format embeds text properties.

* **Direct**:
  * "Extract EXIF metadata from Documents/photos/trip.jpg."
  * "Show document properties for D:/Projects/reports/summary.docx."
* **Casual / Conversational**:
  * "what camera and GPS info is on this photo?"
  * "pull the author and title from that Word doc"
* **Fuzzy Logic & Typos (Real User)**:
  * "extrct exif from trip.jpg"
  * "doc props for sumary.docx"
* **Vague / Symptom-Based**:
  * "I need to know when and where this photo was taken."

---

### 42. `preview_file` *(Planned)*

**Description:** Generates a visual or rich preview of a supported document, image, or other file (thumbnail, first page render, or inline preview)—not just the character peek of `read_file_preview`. Built so the user can confirm “is this the right file?” for binaries the model cannot usefully dump as text. Path is required. Prefer `read_file_preview` for plain text; use `preview_file` for images, PDFs, and office docs. Read grant applies.

* **Direct**:
  * "Generate a preview of Documents/photos/trip.jpg."
  * "Preview D:/Projects/reports/summary.pdf without opening the full app."
* **Casual / Conversational**:
  * "show me a quick preview of that image"
  * "thumbnail or preview of the PDF"
* **Fuzzy Logic & Typos (Real User)**:
  * "previe trip.jpg"
  * "preview sumary.pdf pls"
* **Vague / Symptom-Based**:
  * "I just need to glance at the file to make sure it's the right one."

---

## Permission & indexing notes

* First write/move/trash in a new folder usually triggers a folder grant prompt. Approve the correct folder before expecting later tools to succeed silently.
* Indexing may start after a grant; chat header can show indexing status (pause / resume / cancel). Details: [file_tools_test.md](file_tools_test.md) §28.
* `run_command` is registered alongside file tools in DI but is covered under [agentic-system-tools.md](agentic-system-tools.md), not this file.
* Planned tools (26–42) are documented for prompt design only until they are implemented and registered.
