Skip to main content
Glama

Compare two documents

compare_documents
Read-onlyIdempotent

Compare two Word documents to return paragraph differences, SHA-256 hashes, coverage diagnostics, and a tracked-change plan tied to the original snapshot; writes nothing.

Instructions

Read two Word documents and return paragraph differences, exact input SHA-256 hashes, coverage diagnostics, and a tracked-change plan bound to the original snapshot. Covered: text added, removed or changed in free body paragraphs, and text changed inside a table cell when the table's geometry is unchanged. The same words split differently across equally formatted runs are not a difference, because Word re-segments runs constantly. Refused, with a per-area diagnostic and no plan: changed table geometry, a cell whose formatting changed along with its words, paragraph formatting or style changes, and changes in headers, footers, notes, images, numbering or other parts. Differences found in the areas that are covered are still reported when another area blocks the plan, so a refusal tells you what it saw. Unsupported changes make isComplete false and plan null. This tool writes nothing; preview and apply the returned plan against the original document.

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": {
      "originalConnectionId": "<originalConnectionId>",
      "originalDocumentId": "<originalDocumentId>",
      "revisedConnectionId": "<revisedConnectionId>",
      "revisedDocumentId": "<revisedDocumentId>",
      "revisionAuthor": "<revisionAuthor>"
    },
    "name": "compare_documents"
  }
}

Input Schema

NameRequiredDescriptionDefault
revisionAuthorYesOfficeAgent Compare
revisedDocumentIdYes
originalDocumentIdYes
revisedConnectionIdYes
originalConnectionIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.8.0

TDQS

A4.8/5.0
Behavior5/5

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

Far exceeds what the annotations declare. It discloses the refusal categories, that per-area diagnostics accompany a refusal, that isComplete=false and plan=null under unsupported changes, that findings are still reported when another area blocks the plan, and that the tool writes nothing, so preview and apply handle the write.

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-loaded with the return values, then the coverage boundary, then the failure semantics, then the write-nothing warning. Dense but each sentence earns its place; the run-segmentation aside is slightly digressive though it explains a real non-difference case.

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?

No output schema exists, so the description carries the full burden and does: it names the returned artifacts, the refusal diagnostics, the completeness flag, and the plan-binding requirement, giving an agent everything needed to call and interpret the tool.

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 description coverage is 0% for 5 required params, so the description must compensate. It clarifies that the plan is bound to the original snapshot and implies the two document/connection pairs are the originals versus revised, but it does not explain revisionAuthor, which the schema lists only by name and default.

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+resource ('Read two Word documents and return paragraph differences') and enumerates exactly what is compared versus refused, which distinguishes it from siblings like edit_document, apply_plan, and preview_document_merge.

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?

The covered/refused split functions as an explicit when-to-use/when-not-to-use boundary with per-area reasons, and it directs the agent to preview and apply the returned plan against the original document, naming the downstream siblings.

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