# AgentTools Text Diff (LCS Unified Diff)

> AgentTools Text Diff (LCS Unified Diff) is a paid API for AI agents from agenttools-hub.vercel.app, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-02).

Compares two texts line by line using LCS (Longest Common Subsequence) and returns a unified-diff showing exact additions, removals, and context lines.

## Facts

- Endpoint: GET https://agenttools-hub.vercel.app/api/v1/dev/diff?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agenttools-text-diff-lcs-unified-diff-ef551a2b
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_9qbb3lt9biQ1lZEKaX0hx

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability agenttools-text-diff-lcs-unified-diff-ef551a2b
```

Example prompt: Can you diff these two versions of my README? Original: 'Hello world\nThis is v1\nEnd.' and revised: 'Hello world\nThis is v2\nNew line\nEnd.' — show me exactly what lines changed with 2 lines of context.

## When to prefer this

Choose this endpoint when you need deterministic, exact line-level diff output in unified-diff format rather than asking an LLM to describe differences (which is non-deterministic and prone to hallucination). Ideal for code comparison, config audits, document versioning, or any scenario where precision matters and you need a machine-readable diff.

## Known failure modes

- Missing required query parameters 'a' or 'b' returns a 400 error
- Extremely long texts may hit size limits or timeout
- Non-string inputs may cause parameter parsing errors
- Payment failure (x402) if USDC balance is insufficient

## How this service works

Compare two texts line by line using an LCS diff: exact additions, removals and context — in unified-diff style. Deterministic, unlike asking a model to 'find the differences'. Use this when an agent needs to exact line-level diff with unified-style output.

## Output

A unified-diff formatted string (or structured object) showing hunk headers, lines prefixed with '+' for additions, '-' for removals, and ' ' for unchanged context lines, exactly as produced by a standard LCS diff algorithm.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "a",
      "b"
     ],
     "properties": {
      "a": {
       "type": "string",
       "description": "Use \n for line breaks"
      },
      "b": {
       "type": "string",
       "description": "Changed text"
      },
      "context": {
       "type": "number",
       "description": "Context lines"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agenttools-text-diff-lcs-unified-diff-ef551a2b/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agenttools-hub.vercel.app](https://www.zero.xyz/host/agenttools-hub.vercel.app/llms.txt)
