# Forest Agent Tools – JSON Diff

> Forest Agent Tools – JSON Diff is a paid API for AI agents from http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-22).

Deep-compares two JSON values with deterministic key ordering and index-based array semantics, returning bounded added, removed, and changed paths with before/after primitive values.

## Facts

- Endpoint: POST https://http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run/json/diff?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-22
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/forest-agent-tools-json-diff-2795cab4
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_nIwIBWcIos8ua2iwPUKfU

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 forest-agent-tools-json-diff-2795cab4 -d '<json body>'
```

Example prompt: Compare these two JSON objects and tell me exactly what changed — what was added, removed, or modified: before is {"name":"Alice","age":30,"role":"admin"} and after is {"name":"Alice","age":31,"role":"user","email":"alice@example.com"}.

## When to prefer this

Choose this endpoint when you need a deterministic, structured diff of two JSON values with explicit array index tracking and reliable key ordering — especially useful for auditing agent-generated mutations, detecting API response drift, or comparing configuration snapshots. Prefer over client-side diffing when you need a paid, auditable, bounded result without writing custom comparison logic.

## Known failure modes

- Malformed JSON in before or after fields returns an error indicating which value failed to parse
- Excessively large or deeply nested JSON may hit bounding limits and return a partial or truncated diff
- Missing before or after field in the request body results in a validation error
- Payment not included or invalid returns HTTP 402 with machine-readable payment contract

## How this service works

Machine-readable contract for active Forest paid capabilities. Unsigned paid calls return HTTP 402 with a PAYMENT-REQUIRED x402 challenge.

## Output

A bounded diff result listing added paths, removed paths, and changed paths between the before and after JSON values. Changed paths include the primitive before and after values. Uses deterministic object-key ordering and explicit index-based array semantics. No network requests, model inference, persistence, or mutations are performed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "after": {
   "description": "Public after value used to scope this lookup."
  },
  "before": {
   "description": "Public before value used to scope this lookup."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "ok": true,
  "data": {
   "equal": false,
   "scope": "caller_supplied_json_structural_diff_only",
   "truncated": false,
   "differences": [],
   "input_bytes": 0,
   "nodes_visited": 0,
   "array_semantics": "index_based",
   "difference_count": 0
  },
  "meta": {
   "cache": "miss",
   "provider": "local-json",
   "checked_at": "2026-01-01T00:00:00.000Z",
   "duration_ms": 0
  },
  "version": "1",
  "capability": "json.diff"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/forest-agent-tools-json-diff-2795cab4/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run](https://www.zero.xyz/host/http--forest-gas-station-mainnet--lcjl27p8lmjs.code.run/llms.txt)
