{"uid":"cap_QR0E7KeBbH3BU1dZGd0mB","slug":"agent-tool-call-diff-api-96bccd45","name":"Agent Tool-Call Diff API","description":"Compare two agent run sequences and see how their tool calls differ. Send before and after arrays of tool calls (name/args or tool/arguments shape) and get back which calls were added, removed, or reordered, plus per-call argument drift with the exact changed argument paths from a deep compare. The result is exact and reproducible: the same replay comparison always returns the same diff. Built for agent regression diff work: confirming a prompt or code change didn't silently alter which tools an agent calls or what it passes them. Use it as a tool call diff API, an agent action drift checker, or a replay comparison step in CI before shipping an agent change.","url":"https://x402.agentutility.ai/tool-call-diff","method":"POST","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method","bodyType","body"],"properties":{"body":{"required":["before","after"],"properties":{"after":{"type":"array","description":"The new tool-call sequence to compare against 'before', same shape. Required, max 500 entries."},"before":{"type":"array","description":"The baseline tool-call sequence: a JSON array of call objects, each shaped {name, args} (or {tool, arguments} / {tool_name, input}). Required, max 500 entries."}}},"type":{"type":"string","const":"http"},"method":{"enum":["POST"],"type":"string"},"bodyType":{"enum":["json","form-data","text"],"type":"string"}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"added":{"type":"array"},"removed":{"type":"array"},"identical":{"type":"boolean"},"reordered":{"type":"array"},"after_count":{"type":"integer"},"arg_drifted":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"arg_diffs":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"after":{"type":"string"},"before":{"type":"string"}}}},"index_after":{"type":"integer"},"index_before":{"type":"integer"}}}},"before_count":{"type":"integer"},"unchanged_count":{"type":"integer"}}}}}}},"responseSchema":{"type":"json","example":{"added":[],"removed":[],"identical":false,"reordered":[],"after_count":2,"arg_drifted":[{"name":"search","arg_diffs":[{"path":"$.q","after":"world","before":"hello"}],"index_after":0,"index_before":0}],"before_count":2,"unchanged_count":1}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.008","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"registry","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.008/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.008","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.008","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_7B1-oF4YVL9-g4nxsKSJa","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.008","costPer":"request","priority":0,"asset":null,"unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Compares two sequences of agent tool calls to identify added, removed, reordered, and argument-drifted calls between a before and after replay.","exampleAgentPrompt":"Compare these two tool-call sequences and tell me what changed — here's the before array and the after array — I want to know which calls were added, removed, reordered, and whether any argument values drifted, with the exact changed paths.","exampleUseCases":[{"title":"CI regression check before agent deploy","prompt":"Before I ship this agent update, compare the tool calls from the old run to the new run and tell me if anything changed — any calls added, removed, reordered, or arguments that drifted from their old values."},{"title":"Prompt change impact audit","prompt":"I just rewrote my agent's system prompt — can you diff the before and after tool-call sequences so I can see if the new prompt silently changed which tools the agent calls or what arguments it passes them?"},{"title":"Debug unexpected agent behavior shift","prompt":"My agent started behaving differently after a dependency update. Compare these two tool-call replay arrays and show me exactly which calls are new, which are gone, and where any argument values changed, with the specific JSON paths that drifted."}],"resultDescription":"Returns a JSON object with: `identical` boolean, `before_count` and `after_count` integers, `added` array of new calls, `removed` array of dropped calls, `reordered` array of calls that changed position, `unchanged_count` integer, and `arg_drifted` array of calls whose arguments changed — each with the call name, before/after index positions, and a list of per-argument diffs showing the JSON path, old value, and new value.","failureModes":["Missing `before` or `after` arrays returns a validation error","Arrays exceeding 500 entries are rejected","Malformed tool-call objects (missing name/args or equivalent shape) may cause parse errors","Payment failure via x402 results in 402 response before processing","Mismatched tool-call object shapes between before and after may produce unexpected diff results"],"whenToPreferThis":"Choose this endpoint when you need an exact, reproducible, deep diff of two agent tool-call sequences — specifically when you want to catch argument-level drift (not just presence/absence of calls) across replays. It is purpose-built for agent regression workflows and CI pipelines where you need deterministic, structured output rather than a fuzzy semantic comparison. Prefer it over general-purpose JSON diff tools because it understands tool-call object shapes natively and surfaces reordering as a distinct category.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T00:57:55.744Z","isFirstParty":false}