Finds elements that exist in either array but not in both — the symmetric difference operation. Access via MCP in Cursor or Windsurf, or call GET /v1/array/symmetric-difference directly. Pass two arrays like [1,2,3] and [2,3,4] to get [1,4]. Returns deterministic results perfect for set operations in AI workflows.
curl "https://tinyfn.io/v1/array/symmetric-difference" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/array/symmetric-difference', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/array/symmetric-difference',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's array tools:
{
"mcpServers": {
"tinyfn-array": {
"url": "https://tinyfn.io/mcp/array",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Items that appear in either array but not in both. If array A has [1,2,3] and array B has [2,3,4], the symmetric difference is [1,4].
Connect TinyFn's MCP server and call the array_symmetric_difference tool with your two arrays. Perfect for AI agents comparing datasets or finding unique elements.
Implementation varies by tool — some preserve insertion order, others don't. Check the specific response format for your use case.
Yes, works with mixed types like strings, numbers, booleans. Elements are compared by value, so [1, '1'] treats the number 1 and string '1' as different.
Regular difference is A minus B (items in A but not B). Symmetric difference is (A minus B) plus (B minus A) — items unique to either array.
Get your free API key and start using Array Symmetric Difference in seconds.
Get Free API Key