word_patch_with_track_changes
Replace text in Word documents with track changes enabled, creating revision marks that show deletions and insertions for auditable review.
Instructions
Replace text in a document with Word Track Changes enabled.
Creates revision marks (insertions/deletions) that appear in Word's review mode. Old text is marked as deleted (red strikethrough) and new text is marked as inserted (green underline).
This is useful for:
Auditable document changes
Review workflows where changes need approval
Comparing before/after states in Word
Example: patch_with_track_changes( file_path="04. Artifacts/contoso-sow.docx", replacements={ "": "Contoso Ltd", "": "Cloud Migration", "[TBD]": "Q1 2026" }, author="Solution Architect" )
Args: file_path: Path to the .docx document replacements: Dictionary mapping old text to new text author: Name to attribute changes to (appears in Word's review pane) output_path: Optional output path (defaults to overwriting input)
Returns: Status with replacement counts
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_path": "<file_path>",
"replacements": "<replacements>"
},
"name": "word_patch_with_track_changes"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Path to the .docx document | |
| replacements | Yes | Dictionary mapping old text to new text | |
| author | No | Name to attribute changes to (appears in Word's review pane) | |
| output_path | No | Optional output path (defaults to overwriting input) |