{"uid":"cap_9qbb3lt9biQ1lZEKaX0hx","slug":"agenttools-text-diff-lcs-unified-diff-ef551a2b","name":"AgentTools Text Diff (LCS Unified Diff)","description":"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.","url":"https://agenttools-hub.vercel.app/api/v1/dev/diff?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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"}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_p4RqBGTNdVVeq1MO-apYC","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compares two texts line by line using LCS (Longest Common Subsequence) and returns a unified-diff showing exact additions, removals, and context lines.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Code review change detection","prompt":"I have two versions of a Python function and I need to see exactly which lines changed. Original: 'def foo():\\n    return 1\\n    # old comment' and new: 'def foo():\\n    return 2\\n    # updated comment\\n    pass' — show me the unified diff with 1 line of context."},{"title":"Config file audit","prompt":"Compare these two config files line by line and show me every addition and removal: original is 'host=localhost\\nport=8080\\ndebug=true' and the new one is 'host=production.example.com\\nport=443\\ntimeout=30' — I want the full unified diff."},{"title":"Document revision tracking","prompt":"I edited a paragraph and want to see exactly what I changed — here's the before: 'The cat sat on the mat.\\nIt was a sunny day.' and the after: 'The cat sat on the rug.\\nIt was a cloudy afternoon.\\nBirds were singing.' Give me the line-by-line diff with 0 context lines."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-02T12:43:11.701Z","isFirstParty":false,"canonicalSlug":"agenttools-text-diff-lcs-unified-diff-ef551a2b"}