---
title: "Line diff between two texts"
method: POST
path: "/v1/tools/diff"
---

# Line diff between two texts

`POST /v1/tools/diff`

## Request

- Base URL: `https://mcp.cleanor.app`
- URL: `https://mcp.cleanor.app/v1/tools/diff`
- Auth: none declared

Compute a line-by-line diff between two texts, marking removed lines with "-", added with "+" and unchanged with two spaces, plus a change count. Use to see exactly what changed instead of comparing by eye. Capped at 1000 lines per side.

## Request body

- object
  - `a` string, required: The original ("before") text.
  - `b` string, required: The updated ("after") text.

## Response `200`

Tool result: `data` (structured) and `text` (human-readable).

- ToolResult
  - `ok` boolean
  - `tool` string
  - `data` object, nullable
  - `text` string
  - `attribution` string

## Other responses

- `400`: Invalid arguments.
- `429`: Rate limited (120 requests per minute per IP).

---

[API](https://skmtc.dev/cleanor/apis/cleanor-api.md) · [All operations](https://skmtc.dev/cleanor/apis/cleanor-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cleanor/apis/cleanor-api/revisions/5f7be54e7a84?raw)
