Array set difference
array-set-difference · version 1.0.0 · Other utilities · free, no key needed
Return unique left-array values absent from the right array, in first-seen order.
Use when you need to: ordered array set difference · values in left but not right · subtract one JSON array from another.
Decide before calling
Read the versioned contract and the supported scope below. Reuse array-set-difference@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-set-difference@1.0.0 for ordered array set difference. 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
- ordered array set difference
- values in left but not right
- subtract one JSON array from another
- remove matching values from array
- JSON array difference preserving order
- find items absent from second array
Not supported
- symmetric difference
- multiset subtraction
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
left(array of any JSON value, required): max items 256right(array of any JSON value, required): max items 256
Output
standard_version(constant "RFC8785", required)values(array of any JSON value, required): max items 256
Limits
- max input bytes: 32768
- max items: 256
- max iterations: 4095
- max output bytes: 32768
Example
Request input:
{
"left": [
1,
2,
2,
3
],
"right": [
2
]
}
Response:
{
"result": {
"standard_version": "RFC8785",
"values": [
1,
3
]
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "array-set-difference",
"version": "1.0.0",
"input": {
"left": [
1,
2,
2,
3
],
"right": [
2
]
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/array-set-difference/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"left":[1,2,2,3],"right":[2]}'
The machine-readable contract is at /v1/tools/array-set-difference/versions/1.0.0.
CLI
node cli.mjs run array-set-difference 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Array set intersection: Return unique left-array values also in the right array, in first-seen order.
- Array duplicates find: List duplicated JSON values with counts and first indexes, preserving first-seen order.
- Cron next runs: Compute the next requested UTC fire times for a five-field cron schedule and echo the supplied reference instant.
- Cron previous runs: Compute the previous requested UTC fire times for a five-field cron schedule and echo the supplied reference instant.
- Html to plain text: Strip HTML and script/style text, decode supported references; collapse whitespace including inside pre elements.
- Rtf to markdown: Convert an 8 KiB ANSI-1252 RTF text subset to escaped Markdown; unsupported Word features are refused.