Skip to main content
Glama

compare_documents

Compare two DOCX files to generate a tracked-change document showing additions, deletions, and modifications.

Instructions

Diff two DOCX files and produce a tracked-change document.

Paragraph-level LCS diff:

  • Unchanged paragraphs copied verbatim.

  • Deleted paragraphs (in base, absent in revised) wrapped in w:del.

  • Inserted paragraphs (in revised, absent in base) wrapped in w:ins.

  • Modified paragraphs (1:1 replacement) get word-level del+ins inline.

The output is a valid DOCX readable in Word/LibreOffice showing the changes as tracked revisions.

Args: base_path: Path to the original DOCX. revised_path: Path to the revised DOCX. output_path: Destination path. Auto-generated if empty.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
base_pathYes
revised_pathYes
output_pathNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden. It explains the diff algorithm (paragraph-level LCS, word-level del+ins for modified paragraphs) and notes the output is a valid DOCX. It does not cover permissions, error cases, or limitations (e.g., only works with DOCX), but it provides substantial behavioral detail.

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?

The description is reasonably concise with three main components: a main sentence, an algorithm list, and parameter details. The algorithm section is detailed but clear. It could be slightly more concise, but it is well-structured and non-redundant.

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

Completeness4/5

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

Given the complexity of the tool and the presence of an output schema (not detailed here but indicated), the description covers the core behavior, algorithm, and parameters. It lacks information on error handling, compatibility beyond DOCX, or performance, but it is sufficiently complete for an AI agent to understand how to use it.

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?

The input schema has 0% description coverage, so the description's Args section compensates. It adds meaningful descriptions: 'Path to the original DOCX', 'Path to the revised DOCX', 'Destination path. Auto-generated if empty.' This adds value beyond the schema's property names.

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?

The description clearly states the tool diffs two DOCX files and produces a tracked-change document. It uses specific verbs 'Diff' and 'produce', and distinguishes itself from siblings like 'compare_contracts' (likely higher-level) and 'diff_to_text' (outputs text, not DOCX).

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?

The description provides a detailed algorithm explaining how paragraphs are compared and what happens to unchanged, deleted, inserted, and modified paragraphs. However, it does not explicitly state when to use this tool over alternatives like 'diff_to_text' or 'compare_contracts', nor does it mention exclusions or prerequisites.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SecurityRonin/docx-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server