name: reference-preserving-edit description: Use this workflow when editing an existing HWPX while minimizing layout drift by copying first, inspecting the relevant package parts, making bounded edits with the current MCP tools, and validating the result before handoff.
Reference-Preserving Edit
Use this workflow when the document already exists and layout stability matters more than editing speed.
Tool Order
- Create a working copy with
copy_document. - Read the current structure with
get_document_outline,get_paragraphs_text,get_table_text, orhwpx_extract_json. - In advanced mode, inspect sensitive package parts with
package_parts,package_get_xml,package_get_text,object_find_by_tag, orobject_find_by_attr. - Validate the baseline with
validate_structureif the source document is externally produced or suspicious. - Apply the smallest possible edit:
search_and_replaceorbatch_replacefor anchored text updatesformat_textfor localized stylingset_table_cell_textfor fixed cells- paragraph insertion/deletion only when structure must change
- Re-read the touched areas and rerun
validate_structure.
Minimize Layout Drift
- Prefer replacement over insertion.
- Avoid changing table geometry unless required.
- Limit edits to the smallest paragraph or table region possible.
- Use package inspection when memo anchors, section XML, or dense table layouts make visual assumptions risky.
When To Inspect Package Parts
- The source was generated by another system.
- The visible text is not enough to identify the true anchor.
- You need to confirm which section or package part contains the target content.
Honest Limitations
plan_edit,preview_edit, andapply_editare review/verification pipeline tools, not a full semantic patch engine.- There is no public layout-drift report or structure-diff tool on the active MCP surface.
- Saving is implicit: mutating tools persist immediately, so always start from
copy_documentwhen the original must stay untouched.