# Agent Tool-Call Diff API

> Agent Tool-Call Diff API is a paid API for AI agents from x402.agentutility.ai, paid per call via x402, $0.008/call, status unknown (last checked 2026-09-15).

Compares two sequences of agent tool calls to identify added, removed, reordered, and argument-drifted calls between a before and after replay.

## Facts

- Endpoint: POST https://x402.agentutility.ai/tool-call-diff
- Price: $0.008/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent-tool-call-diff-api-96bccd45
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_QR0E7KeBbH3BU1dZGd0mB

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 agent-tool-call-diff-api-96bccd45 -d '<json body>'
```

Example prompt: 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.

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

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.

## Output

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.

## 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",
    "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"
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "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
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent-tool-call-diff-api-96bccd45/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentutility.ai](https://www.zero.xyz/host/x402.agentutility.ai/llms.txt)
