compare_documents
Compare two Word or ODF documents to generate a tracked-changes output file, either standalone or against session edits.
Instructions
Compare two documents and produce a tracked-changes output document. Provide original_file_path + revised_file_path for standalone comparison, or file_path to compare session edits against the original. DOCX and ODF (.odt) support both modes. DOCX output always uses the revised archive as its package base and publishes tagged revisions; engine, strategy, reconstruction, premerge, and refinement selectors are not exposed. DOCX stats count insertions/deletions as contiguous ranges, expose tagged-token-v1 totals as insertedAtoms/deletedAtoms with atomMetricVersion, and report formatChanges separately from modifiedParagraphs. When a DOCX input difference is preserved in the output without tracked-change markup (for example a removed section's header or footer, or an unsupported header/footer topology), the response includes unrepresented_changes (objects with scope, kind, sectionIndex, for header/footer scopes role, and for the contentControl scope a contentControl identity: a changed w:sdtPr/w:sdtEndPr is published as the revised properties without markup, because CT_SdtPr admits no revision elements) plus one warnings string per entry, and the message carries a WARNING. Both fields are absent when no reportable unrepresented change was detected; the detector covers section properties, selected header/footer stories and content-control properties, so absence is not a guarantee about differences outside that scope. ODF compares at inline granularity (a modified paragraph is marked up in place — only the changed spans are struck or inserted).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| author | No | Author name for track changes. Default: 'Comparison' (DOCX) or the configured AI author (ODF). | |
| file_path | No | Path to the DOCX or ODT file. | |
| compare_moves | No | Detect moved content (DOCX only). Default: true. | |
| ignore_formatting | No | Ignore formatting differences (DOCX only). Default: false. | |
| revised_file_path | No | Path to the revised DOCX or .odt file. | |
| original_file_path | No | Path to the original DOCX or .odt file. | |
| save_to_local_path | Yes | Path to save the tracked-changes output (DOCX or .odt). |