compare_pdfs
Compare two PDF versions page by page to detect changed pages, lines, and visual differences in text or colour, with options for passwords and case-insensitive matching.
Instructions
Compare two versions of a PDF (A, the older, and B, the newer) page by page.
Pages are matched first, by their text, so a page inserted or deleted (or page-number footers shifting) doesn't make every later page look changed; reordered pages show as removed and added. mode "text" compares each matched page's text and lists the lines removed and added (lines shown as written; up to 50 per page and 50,000 characters in all); "visual" matches pages by position and compares how they look, in colour (the % of pixels that differ), returning images of the most changed pages with what was removed in red, added in green and recoloured in blue; "both" matches by text and does both. Pages with no text (e.g. scans) can only be compared visually; in text mode they are "unknown". Whitespace and Unicode forms are ignored; ignore_case ignores case too. complete is false if the 60 s limit stopped some pages being compared. Needs the owner password of a PDF that forbids copying, except in visual mode. Nothing is written to disk.
Any password argument can be "ask": the user then types it on a local page, so it never passes through the chat.
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": {
"path_a": "<path_a>",
"path_b": "<path_b>"
},
"name": "compare_pdfs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | text | |
| path_a | Yes | ||
| path_b | Yes | ||
| password_a | No | ||
| password_b | No | ||
| ignore_case | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| same | Yes | ||
| added | Yes | ||
| images | Yes | ||
| path_a | Yes | ||
| path_b | Yes | ||
| changed | Yes | ||
| pages_a | Yes | ||
| pages_b | Yes | ||
| removed | Yes | ||
| unknown | Yes | ||
| complete | Yes | ||
| identical | Yes | ||
| truncated | Yes | ||
| differences | Yes | ||
| pages_skipped | Yes |