# agent402.tools JSON Deep Merge

> agent402.tools JSON Deep Merge is a paid API for AI agents from agent402.tools, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-14).

Deep-merges two JSON objects where b overrides a on conflicts and arrays are concatenated.

## Facts

- Endpoint: POST https://agent402.tools/api/json-merge
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/agent402-tools-json-deep-merge-899bbe12
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_-_Epi58YVwKvx2bgZjNS9

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 agent402-tools-json-deep-merge-899bbe12 -d '<json body>'
```

Example prompt: Deep-merge these two JSON objects for me — use {"theme":"light","fontSize":14,"plugins":["prettier"]} as the base and {"fontSize":16,"plugins":["eslint"],"debug":true} as the override, so conflicts go to the override and arrays get concatenated.

## When to prefer this

Use this endpoint when you need a true deep merge — not a shallow Object.assign — specifically when you want arrays concatenated rather than replaced and nested objects recursively combined. Ideal for merging configuration objects, combining API response payloads, or layering environment-specific overrides onto a base config.

## Known failure modes

- Non-object input (e.g. array or primitive at top level) may return an error or unexpected result
- Malformed JSON in either field returns a 400 parse error
- Missing required fields a or b may cause a 422 validation error
- Very deeply nested or extremely large objects may hit size or recursion limits

## How this service works

Deep-merge two JSON objects (b wins on conflicts; arrays are concatenated).

## Output

A single merged JSON object where all keys from both inputs are present, b's values win on any conflicting keys, and array values from both objects are concatenated together.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "a": {
   "description": "Base object"
  },
  "b": {
   "description": "Override object"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "result": {
   "n": {
    "p": 1,
    "q": 2
   },
   "x": 1,
   "y": 2
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/agent402-tools-json-deep-merge-899bbe12/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agent402.tools](https://www.zero.xyz/host/agent402.tools/llms.txt)
