{"uid":"cap_tKCBIby1DxhHldoquPYBb","slug":"agent402-tools-text-diff-lcs-71e7797b","name":"agent402.tools Text Diff (LCS)","description":"Line-by-line diff of two texts (LCS). Returns unified-style ops and change counts. Up to 2000 lines per side.","url":"https://agent402.tools/api/text-diff","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"a":{"type":"string","description":"Original text"},"b":{"type":"string","description":"New text"}}},"responseSchema":{"type":"json","example":{"diff":[{"op":" ","line":"line1"},{"op":"-","line":"line2"},{"op":"+","line":"line2 changed"}],"added":1,"removed":1,"unchanged":1}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_c9TEuhLfGF5iddB5Ptwo4","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Computes a line-by-line diff of two texts using LCS and returns unified-style diff operations with change counts.","exampleAgentPrompt":"Show me the line-by-line diff between these two versions of my config file — the original starts with 'timeout=30\\nretries=3\\n...' and the new version starts with 'timeout=60\\nretries=5\\n...' — I want to see exactly which lines were added, removed, or unchanged.","exampleUseCases":null,"resultDescription":"A unified-style list of diff operations (add, remove, equal) for each line, along with counts of how many lines were added, removed, and unchanged between the two input texts.","failureModes":["Input text exceeds 2000 lines per side — the endpoint enforces a line limit and will reject oversized inputs","Missing 'a' or 'b' fields in the request body — returns a validation error","Payment not included or insufficient — returns a 402 Payment Required response","Network timeout if texts are very long near the limit"],"whenToPreferThis":"Use this endpoint when you need a programmatic, line-level diff between two text blocks (up to 2000 lines each) and want structured output — unified-style ops and change counts — rather than a human-readable summary. Prefer this over LLM-based comparison when you need deterministic, exact diff results suitable for downstream processing or automation.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T00:56:59.477Z","isFirstParty":false}