|
16 | 16 |
|
17 | 17 | @tool( |
18 | 18 | description=( |
19 | | - "Reads a DOCX file and returns its text content. Use this to ingest the document into your context window." |
| 19 | + "Reads a DOCX file and extracts its text content. Use this to ingest documents into your context window. " |
| 20 | + "By default (clean_view=False), it returns text with inline CriticMarkup (e.g., {++inserted++}, {--deleted--}, " |
| 21 | + "{==highlighted==}{>>comment<<}) representing Tracked Changes and Comments. " |
| 22 | + "Set clean_view=True ONLY if you want to read the final, clean text, ignoring all redlines and comments." |
20 | 23 | ), |
21 | 24 | annotations={"readOnlyHint": True}, |
22 | 25 | meta={"ui": {"resourceUri": MARKDOWN_UI_URI}}, |
@@ -60,7 +63,12 @@ async def read_docx( |
60 | 63 |
|
61 | 64 |
|
62 | 65 | @tool( |
63 | | - description="Compares two DOCX files and returns a text-based Unified Diff.", |
| 66 | + description=( |
| 67 | + "Compares two DOCX files and generates a text-based Unified Diff. " |
| 68 | + "Use this to see exactly what changed between two versions of a document. " |
| 69 | + "By default (compare_clean=True), it compares the 'Accepted' finalized states of both documents. " |
| 70 | + "Set compare_clean=False if you need to compare the raw underlying text including Tracked Change CriticMarkup." |
| 71 | + ), |
64 | 72 | annotations={"readOnlyHint": True}, |
65 | 73 | ) |
66 | 74 | async def diff_docx_files( |
@@ -140,7 +148,20 @@ def _create_diff_output(original_path: str, modified_path: str, text_orig: str, |
140 | 148 |
|
141 | 149 |
|
142 | 150 | @tool( |
143 | | - description="Applies a batch of document changes (review actions and text edits).", |
| 151 | + description=( |
| 152 | + "Applies a batch of structural edits, text modifications, and review actions to a document. " |
| 153 | + "This is your primary tool for editing DOCX files.\n\n" |
| 154 | + "The `changes` parameter is a list of operations. Each item MUST have a `type`:\n" |
| 155 | + "1. 'modify': Search-and-replace text. Provide exact `target_text` (CRITICAL: include " |
| 156 | + "surrounding context if the word appears multiple times to ensure unique matching) and " |
| 157 | + "`new_text` (the replacement, which supports Markdown like **bold** or _italic_). To " |
| 158 | + "delete text, make `new_text` empty. Do NOT manually write CriticMarkup {++ tags; " |
| 159 | + "the engine handles that.\n" |
| 160 | + "2. 'accept': Finalize a tracked change. Requires `target_id` (e.g., 'Chg:12').\n" |
| 161 | + "3. 'reject': Revert a tracked change. Requires `target_id` (e.g., 'Chg:12').\n" |
| 162 | + "4. 'reply': Reply to a comment. Requires `target_id` (e.g., 'Com:5') and `text`.\n\n" |
| 163 | + "Always provide a realistic `author_name` for Tracked Changes." |
| 164 | + ), |
144 | 165 | annotations={"destructiveHint": True}, |
145 | 166 | ) |
146 | 167 | async def process_document_batch( |
@@ -218,7 +239,12 @@ async def process_document_batch( |
218 | 239 |
|
219 | 240 |
|
220 | 241 | @tool( |
221 | | - description="Accepts all tracked changes in the document and removes comments, creating a clean version.", |
| 242 | + description=( |
| 243 | + "Accepts all tracked changes and removes all comments in a single operation, " |
| 244 | + "producing a finalized clean document. " |
| 245 | + "Use this when a document review is entirely complete and you want to clear all redlines. " |
| 246 | + "For selective acceptance/rejection of specific changes, use `process_document_batch` instead." |
| 247 | + ), |
222 | 248 | annotations={"destructiveHint": True}, |
223 | 249 | ) |
224 | 250 | async def accept_all_changes( |
|
0 commit comments