Array Utilities

Array Dedupe

Array Dedupe removes duplicate values from arrays, returning only unique elements in their original order. Use via MCP in Cursor or Windsurf, or call GET /v1/array/dedupe with your array data. Perfect for cleaning datasets before analysis — handles strings, numbers, and mixed types deterministically without the ambiguity of LLM-generated deduplication logic.

API Endpoint

GET /v1/array/dedupe

Code Examples

curl "https://tinyfn.io/v1/array/dedupe" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/array/dedupe', {
  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/dedupe',
    headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)

Use via MCP

Add to your AI agent

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"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How does array deduplication preserve element order?

Array Dedupe keeps the first occurrence of each unique value and removes subsequent duplicates, maintaining the original sequence of first appearances.

Can I dedupe arrays with mixed data types like strings and numbers?

Yes, it handles mixed types by comparing values exactly — '5' (string) and 5 (number) are treated as distinct elements.

What's the MCP tool name for array deduplication in AI coding assistants?

Use the 'array_dedupe' MCP tool in Cursor, Claude Code, or other supported editors to remove duplicates from arrays in your code.

Does array dedupe work with nested objects or just primitive values?

It works with any JSON-serializable data including nested objects, comparing them by their complete structure and content.

How is deterministic array deduplication better than writing custom code?

TinyFn's implementation handles edge cases consistently across all data types and provides guaranteed deterministic results, unlike ad-hoc deduplication logic that might miss corner cases.

Try Array Dedupe Now

Get your free API key and start using Array Dedupe in seconds.

Get Free API Key