Splits arrays into equally-sized chunks with configurable handling for remainders. Use via MCP in Cursor or Windsurf, or call GET /v1/array/partition with your array and chunk size. Perfect for pagination, batch processing, or data visualization where you need [1,2,3,4,5,6] → [[1,2], [3,4], [5,6]] transformations. Returns consistent JSON structure regardless of input size.
curl "https://tinyfn.io/v1/array/partition" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/array/partition', {
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/partition',
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"
}
}
}
}
Send a GET request to /v1/array/partition with your array and size=3. For [1,2,3,4,5,6,7], you'll get [[1,2,3], [4,5,6], [7]].
The final chunk contains the remaining elements even if smaller than the specified size. Array [1,2,3,4,5] with size=2 returns [[1,2], [3,4], [5]].
Yes, AI agents in Cursor and other MCP-enabled editors can call this tool to partition data structures, especially useful for generating pagination logic or batch processing code.
The tool handles arrays within reasonable REST API limits, typically thousands of elements. For massive datasets, consider client-side chunking before API calls.
This partitions by uniform chunk size, not at specific positions. Use array split tools if you need to break at exact indices rather than equal-sized segments.
Get your free API key and start using Array Partition in seconds.
Get Free API Key