# Array duplicates find

`array-duplicates-find` · version 1.0.0 · Other utilities · free, no key needed

List duplicated JSON values with counts and first indexes, preserving first-seen order.

**Use when you need to: find duplicate values in JSON array · list duplicates with counts · get repeated items and first indexes.**

## Decide before calling

Read the [versioned contract](/v1/tools/array-duplicates-find/versions/1.0.0) and the supported scope below. Reuse `array-duplicates-find@1.0.0` when your input, required output and limits match it. Choose another approach for an unsupported operation.

## Explain the choice

"I can use `array-duplicates-find@1.0.0` for find duplicate values in JSON array. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

## Supported

- find duplicate values in JSON array
- list duplicates with counts
- get repeated items and first indexes
- count duplicate array values
- identify repeated JSON objects
- show duplicate positions in array

## Not supported

- deduplicate the input array
- fuzzy or normalized equality

## Behavior

- All outputs include standard_version.
- Input order is preserved when the result is set-like.
- Integers, decimal strings, and strings are compared without binary floating-point conversion.
- Pure synchronous processing with first-occurrence result ordering.

## Input

- `values` (array of any JSON value, required): max items 256

## Output

- `standard_version` (constant "RFC8785", required)
- `duplicates` (array of object, required): max items 256

## Limits

- max input bytes: 32768
- max items: 256
- max iterations: 4095
- max output bytes: 32768

## Example

Request input:

```json
{
  "values": [
    1,
    "1",
    1,
    {
      "b": 2,
      "a": 1
    },
    {
      "a": 1,
      "b": 2
    }
  ]
}
```

Response:

```json
{
  "result": {
    "standard_version": "RFC8785",
    "duplicates": [
      {
        "value": 1,
        "count": 2,
        "first_index": 0
      },
      {
        "value": {
          "b": 2,
          "a": 1
        },
        "count": 2,
        "first_index": 3
      }
    ]
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "array-duplicates-find",
  "version": "1.0.0",
  "input": {
    "values": [
      1,
      "1",
      1,
      {
        "b": 2,
        "a": 1
      },
      {
        "a": 1,
        "b": 2
      }
    ]
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/array-duplicates-find/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"values":[1,"1",1,{"b":2,"a":1},{"a":1,"b":2}]}'
```

The machine-readable contract is at [/v1/tools/array-duplicates-find/versions/1.0.0](/v1/tools/array-duplicates-find/versions/1.0.0).

### CLI

```sh
node cli.mjs run array-duplicates-find 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Array set difference](/tools/array-set-difference): Return unique left-array values absent from the right array, in first-seen order.
- [Array set intersection](/tools/array-set-intersection): Return unique left-array values also in the right array, in first-seen order.
- [Stats histogram](/tools/stats-histogram): Count decimal-string values in caller-supplied fixed bins and return below- and above-range totals.
- [Bytes format human](/tools/bytes-format-human): Format an exact byte count as both SI and IEC strings and return the rounding mode used.
- [Cron describe fields](/tools/cron-describe-fields): Parse a five-field cron expression and return each field’s expanded numeric values and wildcard status.
- [Rtf inspect](/tools/rtf-inspect): Inspect an 8 KiB ANSI-1252 RTF text subset: paragraphs, omitted destinations, pictures, objects and warnings.
