Your data agent needs to sort 50 items, remove duplicates, and split into chunks of 10. LLMs approximate these operations on large lists, sometimes dropping items or producing incorrect orderings. These tools operate on actual data structures with guaranteed correctness.
All Array Tools (21)
Your agent gets access to 21 array tools via the /mcp/array/ endpoint. Here's the complete list:
| Tool | Description |
|---|---|
array/intersection | Array Intersection |
array/union | Array Union |
array/difference | Array Difference |
array/symmetric-difference | Array Symmetric Difference |
array/is-subset | Is Subset |
array/reverse | Array Reverse |
array/rotate | Array Rotate |
array/first | Array First |
array/last | Array Last |
array/nth | Array Nth |
array/slice | Array Slice |
array/compact | Array Compact |
array/zip | Array Zip |
array/unzip | Array Unzip |
array/fill | Array Fill |
array/repeat | Array Repeat |
array/group-by-length | Group By Length |
array/partition | Array Partition |
array/interleave | Array Interleave |
array/dedupe | Array Dedupe |
array/frequency | Array Frequency |
Agent Scenarios
Here's how real agents use these tools:
1. Data pipeline agent
An ETL agent removes duplicate records from a dataset before loading. array/unique guarantees no duplicates.
array/unique
{ "array": [1, 2, 2, 3, 3, 3, 4] }
2. Batch processing agent
A processing agent splits a list of items into batches of 10 for parallel processing.
array/chunk
{ "array": [1, 2, 3, "..."], "size": 10 }
3. A/B testing agent
A testing agent randomly shuffles user IDs for test group assignment.
array/shuffle
{ "array": ["user1", "user2", "user3", "user4"] }
MCP Setup
Add array tools to your agent in under 2 minutes. Choose your client:
Claude Desktop / Claude Code
Add this to your MCP config:
{
"mcpServers": {
"tinyfn-array": {
"url": "https://api.tinyfn.io/mcp/array/",
"headers": {
"X-API-Key": "your-api-key"
}
}
}
}
Cursor
Go to Settings > MCP and add a new server:
- Type: SSE
- URL:
https://api.tinyfn.io/mcp/array/sse - Headers:
X-API-Key: your-api-key
Tip: Use the category-specific endpoint (/mcp/array/) for the best experience. The all-in-one endpoint (/mcp/all/) works too but has 500+ tools which some clients handle less efficiently.
When to Use These Tools
Use array MCP tools when your agent needs to:
- Guarantee correctness — when wrong answers have real consequences
- Process user data — when you're operating on actual user input, not hypothetical examples
- Maintain consistency — when the same input must always produce the same output
You don't need these tools for casual conversation or rough estimates. Use them when precision matters.
Ready to add array tools to your agent?
Get Free API Key 100 requests/month free. No credit card required.Frequently Asked Questions
Why can't LLMs sort arrays reliably?
LLMs process arrays as text tokens. For short arrays they often get sorting right, but with longer arrays (20+ items) they frequently drop items, duplicate entries, or produce incorrect orderings.
What array operations does TinyFn support?
TinyFn provides sort, reverse, shuffle, unique (dedup), chunk, flatten, intersection, union, difference, and various other array manipulation tools.
What's the maximum array size?
TinyFn handles arrays up to the API request size limit. For typical use cases (hundreds to thousands of items), performance is excellent.