# AI Contract Redline: Compare Signed Documents Against Originals

> Automatically redline any signed contract or agreement against its original and produce an exhaustive change report before counter-signing. Upload the returned signed document (PDF, DOCX, or scanned image), name the original stored in Google Drive (DOCX or native Google Doc), and the workflow OCRs the signed copy, locates and downloads the original from Drive, converts both to clean text, and surfaces every difference categorized by type: substantive wording and clause changes with section numbers and side-by-side quotes, filled-in fields such as parties, effective dates, dollar amounts, addresses, and signer names and titles, signature block label differences, DocuSign and other e-signature artifacts, OCR rendering artifacts to ignore, and shared typos worth fixing in the original. Built for legal contract review, NDA comparison, MSA and SOW intake, vendor agreement onboarding, employment offer letter audits, partnership and referral agreement review, sales contract redlining, real estate purchase agreement comparison, insurance policy diff, lease and rental agreement review, and any returned-document intake workflow where you need to know exactly what changed before filing or counter-signing. Eliminates manual side-by-side reading, accelerates legal and operations review cycles, and prevents accidental acceptance of unfavorable revisions hidden inside a returned signed document.

Content type: workflow
Source URL: https://www.agentpmt.com/agent-workflow-skills/ai-contract-redline-compare-signed-documents-against-originals
Markdown URL: https://www.agentpmt.com/api/agent/workflows/ai-contract-redline-compare-signed-documents-against-originals?format=agent-md
Updated: 2026-04-25T00:38:15.882Z
Author: firef1ie

---

Estimated time saved: 45 minutes.

## Tools

- Document OCR Agent
- Google Drive
- MarkItDown Hosted Markdown Generator

## Workflow Outline

1. Collect Inputs: Goal: Confirm the two documents the user wants to compare: the signed/returned document and the original. | Inputs: User chat message and any uploaded files. The signed document may be referenced by File Management file...
2. OCR Signed Document: Pass the signed_file_id from the previous step as file_ids: [signed_file_id]. Extract plain text only - we do not need entities or per-page metadata for the diff. Preserve the ful...
3. Find Original in Drive: Pass the original_query from gather-inputs as the query parameter. If multiple results match, prefer the most recently modified file owned by the user. If zero results, surface th...
4. Download Original: Use the chosen file's id from find-original as file_id. For native Google Docs add export_format: "txt". For DOCX/PDF/other binary files omit export_format - the download produces...
5. Extract Original Text: Pass the signed_url from download-original as the url parameter. MarkItDown returns the original as Markdown text we can diff against the OCR output. Preserve the full markdown in...
6. Compare and Diff: Goal: Produce an exhaustive, accurate list of every difference between the OCR'd signed document text and the original markdown. | Inputs: 1) Plain text from ocr-signed-doc (the signed document). 2) Markdown from extrac...
7. Deliver Report: Goal: Return the diff report to the user as the final assistant message, formatted for quick legal review. | Inputs: The categorized diff from compare-documents. | Outputs: A single Markdown response that opens with a o...

## Frequently Asked Questions

### How do I connect this workflow to my local agent like OpenClaw or Claude Code?

You can install the local MCP server by opening a terminal and running:

```
npm install -g @agentpmt/mcp-router
agentpmt-setup
```

This will connect you to local agents like Claude Code, Windsurf, Grok Build, Cursor, etc.

Alternatively you can connect to the hosted version with this config block, no installation required:

```
{
  "mcpServers": {
    "agentpmt": {
      "type": "streamable-http",
      "url": "https://api.agentpmt.com/mcp",
      "headers": {
        "Authorization": "Bearer <AGENTPMT_BEARER_TOKEN>",
        "x-instance-metadata": "{\"client\":\"generic-mcp\",\"platform\":\"remote\"}"
      }
    }
  }
}
```

[View MCP Connection Instructions](/docs/mcp-reference/connection) for more details.

### How do I trigger this workflow?

You can use it here in the browser by clicking the 'Try It' button.

If you 'star' the workflow it will save to your dashboard for quick access.

To use the workflow in an external agent, make sure you have followed the steps to connect it to the MCP server and then copy / paste this prompt, or just tell it to use the AgentPMT MCP server and use this workflow.

> Call the AgentPMT-Workflow-Skills tool with action 'get\_workflow\_skill' and skill\_id 69ec0559fafea730edcbc179 ("AI Contract Redline: Compare Signed Documents Against Originals").