{
  "name": "text.diff",
  "group": "text",
  "summary": "Unified diff between two texts, with change statistics and a similarity score.",
  "description": "Produces a git-style unified diff plus structured hunks and a similarity ratio. Compare by line for code and config, or by word to see edits inside a paragraph. Useful for confirming exactly what changed before writing a file, and for summarising a change without re-reading both versions.",
  "keywords": [
    "diff",
    "text compare",
    "unified diff",
    "compare strings",
    "changes",
    "similarity"
  ],
  "endpoint": "https://fluentedi.com/v1/text/diff",
  "mcp_name": "text_diff",
  "makes_network_request": false,
  "parameters": {
    "type": "object",
    "properties": {
      "a": {
        "description": "Original text.",
        "type": "string",
        "maxLength": 200000
      },
      "b": {
        "description": "Modified text.",
        "type": "string",
        "maxLength": 200000
      },
      "mode": {
        "description": "Granularity of comparison.",
        "type": "string",
        "enum": [
          "line",
          "word"
        ],
        "default": "line"
      },
      "context": {
        "description": "Lines of unchanged context around each hunk.",
        "type": "integer",
        "default": 3,
        "minimum": 0,
        "maximum": 20
      },
      "ignore_whitespace": {
        "description": "Ignore leading/trailing whitespace differences.",
        "type": "boolean",
        "default": false
      }
    },
    "required": [
      "a",
      "b"
    ],
    "additionalProperties": false
  },
  "examples": [
    {
      "description": "Diff two config versions",
      "url": "https://fluentedi.com/v1/text/diff?a=host%3A%20localhost%0Aport%3A%208080%0A&b=host%3A%200.0.0.0%0Aport%3A%208080%0Atls%3A%20true%0A",
      "args": {
        "a": "host: localhost\nport: 8080\n",
        "b": "host: 0.0.0.0\nport: 8080\ntls: true\n"
      }
    },
    {
      "description": "Word-level edits in a sentence",
      "url": "https://fluentedi.com/v1/text/diff?a=the%20quick%20brown%20fox&b=the%20slow%20brown%20dog&mode=word",
      "args": {
        "a": "the quick brown fox",
        "b": "the slow brown dog",
        "mode": "word"
      }
    }
  ],
  "suggestion": null
}