Skip to content

Commit feda4fe

Browse files
committed
Updated function descriptions
1 parent 138d73a commit feda4fe

1 file changed

Lines changed: 30 additions & 4 deletions

File tree

src/adeu/mcp_components/tools/document.py

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616

1717
@tool(
1818
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."
2023
),
2124
annotations={"readOnlyHint": True},
2225
meta={"ui": {"resourceUri": MARKDOWN_UI_URI}},
@@ -60,7 +63,12 @@ async def read_docx(
6063

6164

6265
@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+
),
6472
annotations={"readOnlyHint": True},
6573
)
6674
async def diff_docx_files(
@@ -140,7 +148,20 @@ def _create_diff_output(original_path: str, modified_path: str, text_orig: str,
140148

141149

142150
@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+
),
144165
annotations={"destructiveHint": True},
145166
)
146167
async def process_document_batch(
@@ -218,7 +239,12 @@ async def process_document_batch(
218239

219240

220241
@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+
),
222248
annotations={"destructiveHint": True},
223249
)
224250
async def accept_all_changes(

0 commit comments

Comments
 (0)