---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/tools/comparison/variables/compareRecordsTool.md
description: >-
  Compare two JSON objects and report keys only in A, keys only in B, keys with
  matching values, and keys with differing values.
---

# Variable: compareRecordsTool

```ts
const compareRecordsTool: Tool<SpooledArtifact>;
```

Defined in: [batteries/tools/comparison/index.ts:127](https://github.com/NHTIO/ADK/blob/v1.20260605.0/src/batteries/tools/comparison/index.ts#L127)

Compare two JSON objects and report keys only in A, keys only in B, keys with matching
values, and keys with differing values.

## Remarks

Accepts JSON strings (not pre-parsed objects) so the schema can validate the input
shape uniformly across providers. When `deep` is true (default), nested objects and arrays
are compared structurally; when false, comparison reduces to JSON serialisation equality.
