Splits an array of paired elements into two separate arrays, essentially reversing a zip operation. Access via MCP in Cursor or Windsurf, or call GET /v1/array/unzip directly. Input [[1,2], [3,4], [5,6]] returns two arrays: [1,3,5] and [2,4,6]. Perfect for separating coordinates, key-value pairs, or any structured paired data.
curl "https://tinyfn.io/v1/array/unzip" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/array/unzip', {
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/unzip',
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"
}
}
}
}
Takes an array of pairs like [[a,b], [c,d]] and returns two arrays: [a,c] and [b,d]. The first array contains all first elements, the second contains all second elements.
The function expects pairs (2-element subarrays). With longer subarrays, it extracts only the first two elements from each subarray.
Empty array returns two empty arrays. If subarrays have different lengths or missing elements, the function handles gracefully by using undefined for missing values.
In Cursor or Claude Code, request "unzip this array of coordinates" and the MCP tool handles the REST call automatically, returning separated x and y coordinate arrays.
Common for separating coordinate pairs, splitting key-value data, or processing CSV-like paired data where you need columns separated for individual analysis or plotting.