Array Zip combines two arrays element-wise into pairs, creating a new array of tuples. Access via MCP in Cursor or Windsurf, or REST at GET /v1/array/zip with arrays as parameters. Returns [[a1,b1], [a2,b2], ...] format. Stops at the shorter array's length, making it safe for mismatched sizes.
curl "https://tinyfn.io/v1/array/zip" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/array/zip', {
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/zip',
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"
}
}
}
}
Zip stops at the length of the shorter array, discarding extra elements from the longer array without errors.
Returns an array of two-element arrays (tuples): [[first_array[0], second_array[0]], [first_array[1], second_array[1]], ...].
Yes, array zip works with mixed types. You can zip strings with numbers, booleans with objects, etc.
Call the array_zip tool with two array parameters. The AI agent gets deterministic pairing instead of potentially incorrect manual iteration.
Zipping with any empty array returns an empty array, regardless of the other array's contents.