Skip to main content
Glama

doc_compare

Create a redline .docx comparing an old and new Word document, marking every difference as a tracked change for review and accept/reject in Word without altering the originals.

Instructions

Write a redline: a new .docx at output (which must not exist) holding the new version with every difference from old as a tracked change (author default Claude, date ISO 8601 with time zone, default now), so a writer reviews and accepts or rejects them in Word. The input files are never modified; the redline is verified (accepting every change gives the new text) or removed (VERIFY_FAILED_RESTORED). Use doc.diff for the alignment as data without writing a file. Returns the output path and hash, per-kind paragraph counts and the revision count.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
newYesPath of the later version (.docx).
oldYesPath of the earlier version (.docx).
tagNoAppended to the author as `author (tag)`.
dateNoRevision date, ISO 8601 with time zone.
authorNoRevision author (default Claude).
outputYesPath of the redline to create (must not exist).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYesAlways true on success.
opYesThe operation that ran.
apiYesAPI version (1.0).
docNoThe document read or written: path, sha256 and paragraph count.
nextYesCursor for the next page (pass as cursor), or null.
resultYesWhat the operation returns.
warningsYesThings to know about the result.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.7.2
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "api": {
      +      "description": "API version (1.0).",
      +      "type": "string"
      +    },
      +    "doc": {
      +      "description": "The document read or written: path, sha256 and paragraph count.",
      +      "properties": {
      +        "characters": {
      +          "description": "text.normalize of a text string: its length.",
      +          "type": "integer"
      +        },
      +        "paragraphs": {
      +          "description": "Body paragraphs.",
      +          "type": "integer"
      +        },
      +        "path": {
      +          "description": "Path of the document.",
      +          "type": "string"
      +        },
      +        "sha256": {
      +          "description": "sha256 of the file (pass as expect.sha256 to a write).",
      +          "type": "string"
      +        },
      +        "source": {
      +          "description": "A .txt/.md/.odt source's format, encoding and split mode; \"text\" for a text string (text.normalize).",
      +          "type": [
      +            "object",
      +            "string"
      +          ]
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "next": {
      +      "description": "Cursor for the next page (pass as cursor), or null.",
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "ok": {
      +      "description": "Always true on success.",
      +      "type": "boolean"
      +    },
      +    "op": {
      +      "description": "The operation that ran.",
      +      "type": "string"
      +    },
      +    "result": {
      +      "description": "What the operation returns.",
      +      "properties": {
      +        "author": {
      +          "description": "Revision author stamped on the changes.",
      +          "type": "string"
      +        },
      +        "date": {
      +          "description": "Revision date (UTC, ISO 8601).",
      +          "type": "string"
      +        },
      +        "new": {
      +          "description": "The later version.",
      +          "properties": {
      +            "characters": {
      +              "description": "text.normalize of a text string: its length.",
      +              "type": "integer"
      +            },
      +            "paragraphs": {
      +              "description": "Body paragraphs.",
      +              "type": "integer"
      +            },
      +            "path": {
      +              "description": "Path of the document.",
      +              "type": "string"
      +            },
      +            "sha256": {
      +              "description": "sha256 of the file (pass as expect.sha256 to a write).",
      +              "type": "string"
      +            },
      +            "source": {
      +              "description": "A .txt/.md/.odt source's format, encoding and split mode; \"text\" for a text string (text.normalize).",
      +              "type": [
      +                "object",
      +                "string"
      +              ]
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "old": {
      +          "description": "The earlier version.",
      +          "properties": {
      +            "characters": {
      +              "description": "text.normalize of a text string: its length.",
      +              "type": "integer"
      +            },
      +            "paragraphs": {
      +              "description": "Body paragraphs.",
      +              "type": "integer"
      +            },
      +            "path": {
      +              "description": "Path of the document.",
      +              "type": "string"
      +            },
      +            "sha256": {
      +              "description": "sha256 of the file (pass as expect.sha256 to a write).",
      +              "type": "string"
      +            },
      +            "source": {
      +              "description": "A .txt/.md/.odt source's format, encoding and split mode; \"text\" for a text string (text.normalize).",
      +              "type": [
      +                "object",
      +                "string"
      +              ]
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "output": {
      +          "description": "The redline written.",
      +          "properties": {
      +            "path": {
      +              "description": "Its path.",
      +              "type": "string"
      +            },
      +            "sha256": {
      +              "description": "Its sha256.",
      +              "type": "string"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "revisions": {
      +          "description": "Tracked changes in the redline.",
      +          "type": "integer"
      +        },
      +        "summary": {
      +          "description": "Paragraphs per alignment kind.",
      +          "properties": {
      +            "deleted": {
      +              "description": "Deleted.",
      +              "type": "integer"
      +            },
      +            "inserted": {
      +              "description": "Inserted.",
      +              "type": "integer"
      +            },
      +            "merged": {
      +              "description": "Joined.",
      +              "type": "integer"
      +            },
      +            "modified": {
      +              "description": "Edited in place.",
      +              "type": "integer"
      +            },
      +            "moved": {
      +              "description": "Moved.",
      +              "type": "integer"
      +            },
      +            "split": {
      +              "description": "Split in two or more.",
      +              "type": "integer"
      +            },
      +            "unchanged": {
      +              "description": "Unchanged.",
      +              "type": "integer"
      +            }
      +          },
      +          "type": "object"
      +        }
      +      },
      +      "required": [
      +        "old",
      +        "new",
      +        "output",
      +        "summary",
      +        "revisions",
      +        "author",
      +        "date"
      +      ],
      +      "type": "object"
      +    },
      +    "warnings": {
      +      "description": "Things to know about the result.",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "api",
      +    "ok",
      +    "op",
      +    "result",
      +    "warnings",
      +    "next"
      +  ],
      +  "type": "object"
      +}
  2. Addedv0.1.3

TDQS

A4.8/5.0
Behavior5/5

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

With annotations present, it adds substantial behavioral context beyond them: the output must not already exist, input files are never modified, defaults (author Claude, date now), and the verify-or-restore outcome (VERIFY_FAILED_RESTORED). These are exactly the side-effect and failure-mode details an agent needs for a mutation tool.

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

Conciseness4/5

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

Front-loads the core action and packs defaults, verification, and the alternative into a dense but single-purpose block. Slightly long with stacked parentheticals, but nearly every clause earns its place.

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?

An output schema exists, so return-value explanation is optional, yet the description summarizes it (path, hash, per-kind counts, revision count). Combined with the side-effect and failure semantics, an agent has everything needed to invoke it correctly.

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 the baseline is 3, but the description adds a genuinely new default ('date ... default now') and reinforces the must-not-exist constraint on `output`. It mostly mirrors the schema, hence not a 5.

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?

States a specific verb and artifact: 'Write a redline: a new .docx at `output` ... with every difference from `old` as a tracked change.' It explicitly distinguishes itself from the sibling doc.diff, so an agent can tell the two apart without opening a schema.

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

Usage Guidelines5/5

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

Names the alternative and the condition that selects it: 'Use doc.diff for the alignment as data without writing a file.' It also frames the human workflow (writer reviews and accepts/rejects in Word), making the intended use unambiguous.

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