Reverses array elements in deterministic order using `/v1/array/reverse`. Pass any array via MCP in Cursor or Claude Code, or send JSON arrays to the REST endpoint. Returns `[3,2,1]` from `[1,2,3]`. Handles nested arrays, mixed types, and preserves original data structure perfectly.
curl "https://tinyfn.io/v1/array/reverse" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/array/reverse', {
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/reverse',
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"
}
}
}
}
Call the array reverse tool through your MCP-enabled editor with your array as input. It works with any data types including strings, numbers, objects, and nested arrays.
Creates a new reversed array without modifying the original. The function is deterministic and side-effect free.
Yes, it preserves all data types exactly. Arrays with strings, numbers, objects, booleans, and null values are all supported.
Returns an empty array `[]`. The operation is safe for edge cases including single-element and empty arrays.
Unlike JavaScript's built-in reverse() which mutates the original array, TinyFn's version returns a new array, making it safer for functional programming patterns.
Get your free API key and start using Array Reverse in seconds.
Get Free API Key