replace_text
Find and replace text in .docx documents for template substitution, such as updating placeholders like {{CLIENT_NAME}} with actual values.
Instructions
Find and replace text in an existing .docx document. Useful for template substitution — e.g., replacing {{CLIENT_NAME}} with an actual name, or updating dates and contract values.
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": {
"filePath": "<filePath>",
"find": "<find>",
"replace": "<replace>"
},
"name": "replace_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | Path to the .docx file to modify | |
| find | Yes | Text string to search for | |
| replace | Yes | Replacement text (can be empty string to delete the found text) | |
| replaceAll | No | If true (default), replace every occurrence. If false, replace only the first occurrence. |