Compare two documents
compare_documentsUse this when the user wants to compare two documents for differences, compare two versions of a contract, lease, policy or any text, or wants a redline comparison. Put the full text of each version into original_text and revised_text word for word (do not summarize, shorten or fix it); if the user shares screenshots or images of pages, transcribe their text word for word into those fields. For uploaded Word .docx, text PDF or .txt files, pass them in original_file and revised_file. Returns each changed word with the paragraph number, flags changes to numbers, negations and modal verbs (shall, may, must) as material, and makes a redline PDF, an Excel change list and a Word file with tracked changes. Only whitespace and quote style are normalized. Does not read scanned PDFs, does not compare formatting, headers or footers, and does not give legal advice. Do not use for comparing spreadsheets or data tables.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "compare_documents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| show | No | Redline PDF content: "full" (default, the whole revised document with changes marked) or "changes" (only the changed paragraphs). | |
| page_size | No | PDF page size: "Letter" (default) or "A4". | |
| revised_file | No | The REVISED version as an uploaded file: Word .docx, text PDF or .txt, e.g. contract-v2.pdf. | |
| revised_name | No | Optional label for the revised version, e.g. "Lease v2 (landlord edits)". Default: the file name or "Revised". | |
| revised_text | No | The REVISED (newer) version, pasted in full and word for word, e.g. "1. The Tenant may pay rent of $1,250 on the first day of each month.\n2. ...". Leave empty when revised_file is given. | |
| original_file | No | The ORIGINAL version as an uploaded file: Word .docx, text PDF or .txt, e.g. contract-v1.docx. | |
| original_name | No | Optional label for the original, e.g. "Lease v1 (March)". Default: the file name or "Original". | |
| original_text | No | The ORIGINAL (older) version, pasted in full and word for word, e.g. "1. The Tenant shall pay rent of $1,200 on the first day of each month.\n2. ...". Keep paragraphs on separate lines. Leave empty when original_file is given. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| notes | Yes | ||
| counts | Yes | ||
| changes | Yes | ||
| redline | Yes | ||
| revised | Yes | ||
| summary | Yes | ||
| original | Yes | ||
| downloads | Yes | ||
| identical | Yes | ||
| page_size | Yes | ||
| normalized | Yes | ||
| changes_shown | No | ||
| material_changes | Yes |