GenOffice docx patch (byte-preserving)
genoffice_docx_patchRewrite specific .docx paragraphs preserving all unedited content exactly. Only changed blocks are regenerated, so layout and styles stay intact. Outputs a new patched file.
Instructions
Rewrite one or more paragraphs of a .docx using the GenOffice byte-preserving roundtrip: only the edited blocks are regenerated as OOXML fragments; every untouched block keeps its original bytes, so layout, styles, headers, comments and other parts survive. Paragraph formatting (styleId/rawPPr) is carried over. Input: file path + edits [{index, text}] where index comes from genoffice_docx_blocks (0-based visible order). Output: a new patched file (never modifies the original).
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": {
"path": "<path>",
"edits": "<edits>"
},
"name": "genoffice_docx_patch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the source .docx (never modified) | |
| edits | Yes | Paragraph rewrites to apply | |
| outPath | No | Absolute output path; defaults to <dir>/<name>.patched.docx |