Splits arrays into smaller chunks of specified size for batch processing or pagination. Available via MCP in Cursor and other AI coding tools, or REST API at `/v1/misc/chunk`. Pass an array and chunk size — get back nested arrays. Perfect for processing large datasets in manageable batches or implementing pagination logic.
curl "https://tinyfn.io/v1/misc/chunk" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/misc/chunk', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/misc/chunk',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's miscellaneous tools:
{
"mcpServers": {
"tinyfn-misc": {
"url": "https://tinyfn.io/mcp/misc",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Send a GET request with your array and size=3. For example, [1,2,3,4,5,6,7] becomes [[1,2,3],[4,5,6],[7]].
The final chunk contains the remaining items even if fewer than the chunk size. This is standard chunking behavior for uneven divisions.
Yes, it's ideal for breaking large datasets into batches before processing in Claude Code, Cursor, or other MCP-enabled editors.
The chunk size must be a positive integer. Very large chunk sizes are pointless but technically allowed — you'd just get fewer, larger chunks.
Works with any array elements — strings, objects, numbers, booleans. The chunking logic operates on array positions, not content types.