Skip to main content
Glama

compare_documents

Read-only

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

TableJSON Schema
NameRequiredDescriptionDefault
authorNoAuthor name for track changes. Default: 'Comparison' (DOCX) or the configured AI author (ODF).
file_pathNoPath to the DOCX or ODT file.
compare_movesNoDetect moved content (DOCX only). Default: true.
ignore_formattingNoIgnore formatting differences (DOCX only). Default: false.
revised_file_pathNoPath to the revised DOCX or .odt file.
original_file_pathNoPath to the original DOCX or .odt file.
save_to_local_pathYesPath to save the tracked-changes output (DOCX or .odt).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.21.2
    • addedInput schema / properties / compare_moves
      Added value: +{
      +  "description": "Detect moved content (DOCX only). Default: true.",
      +  "type": "boolean"
      +}
    • removedInput schema / properties / engine
      Removed value: -{
      -  "description": "Comparison engine (DOCX only). Default: 'auto'.",
      -  "enum": [
      -    "auto",
      -    "atomizer"
      -  ],
      -  "type": "string"
      -}
    • addedInput schema / properties / ignore_formatting
      Added value: +{
      +  "description": "Ignore formatting differences (DOCX only). Default: false.",
      +  "type": "boolean"
      +}
  2. Changed6 schema fields changedv0.12.1
    • changedInput schema / properties / author / description
      Previous value: -"Author name for track changes. Default: 'Comparison'."New value: +"Author name for track changes. Default: 'Comparison' (DOCX) or the configured AI author (ODF)."
    • changedInput schema / properties / engine / description
      Previous value: -"Comparison engine. Default: 'auto'."New value: +"Comparison engine (DOCX only). Default: 'auto'."
    • changedInput schema / properties / file_path / description
      Previous value: -"Path to the DOCX file."New value: +"Path to the DOCX or ODT file."
    • changedInput schema / properties / original_file_path / description
      Previous value: -"Path to the original DOCX file."New value: +"Path to the original DOCX or .odt file."
    • changedInput schema / properties / revised_file_path / description
      Previous value: -"Path to the revised DOCX file."New value: +"Path to the revised DOCX or .odt file."
    • changedInput schema / properties / save_to_local_path / description
      Previous value: -"Path to save the tracked-changes DOCX output."New value: +"Path to save the tracked-changes output (DOCX or .odt)."
  3. First observed

TDQS

A4.5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only supply readOnlyHint/destructiveHint; the description independently discloses deep behavior: unexposed selectors, revised-archive package base, insertion/deletion counting semantics with atomMetricVersion, formatChanges vs modifiedParagraphs, the unrepresented_changes/warnings contract, warning-message emission, and detector scope limits. This is exactly the beyond-annotations context the rubric rewards.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded, but the definition is a single sprawling paragraph dense with implementation jargon (CT_SdtPr, w:sdtPr/w:sdtEndPr, tagged-token-v1) that would benefit from separation into mode, output, and warning sections. Every clause is informative, but the packing hurts scannability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-mode, seven-parameter tool with no output schema, the description covers both invocation modes, DOCX vs ODF granularity, output statistics fields, and the warning/unrepresented_changes return contract. An agent has enough to call it correctly and interpret the result.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so 3 is the baseline, but the description goes further by explaining how parameters interact (which two paths select standalone mode, which single path selects session mode) and clarifies that certain selectors are deliberately not exposed. That is semantic value the schema alone does not convey.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a concrete verb+resource+artifact: 'Compare two documents and produce a tracked-changes output document.' That instantly distinguishes it from siblings like has_tracked_changes (detection only) and extract_revisions (reads existing markup), since this one generates a new revision-marked document.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit parameter-driven mode selection: original_file_path + revised_file_path for standalone comparison versus file_path to compare session edits against the original. That is clear contextual guidance, but it never names a sibling alternative or a when-not-to-use condition, so it stops short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.