Miscellaneous Utilities

Unique Items

Removes duplicate items from arrays, returning only unique values in their original order. Call via MCP in Cursor or Windsurf, or hit the REST endpoint `/v1/misc/unique`. Perfect for deduplicating user inputs, cleaning datasets, or filtering repeated values in AI workflows. Handles strings, numbers, and mixed data types reliably.

API Endpoint

GET /v1/misc/unique

Code Examples

curl "https://tinyfn.io/v1/misc/unique" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/misc/unique', {
  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/unique',
    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 miscellaneous tools:

{
  "mcpServers": {
    "tinyfn-misc": {
      "url": "https://tinyfn.io/mcp/misc",
      "headers": {
        "X-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Learn more about MCP setup →

FAQ

How do I remove duplicates from an array using the unique items tool?

Send your array to `/v1/misc/unique` or use the MCP tool in your AI editor. It returns unique items while preserving the original order of first occurrence.

Does the unique items function preserve the original order of elements?

Yes, it maintains the order of first appearance. If your array is [3, 1, 3, 2, 1], the result is [3, 1, 2].

Can I use unique items with mixed data types like strings and numbers?

Yes, it handles mixed arrays correctly. ['apple', 1, 'apple', 2, 1] becomes ['apple', 1, 2].

How does unique items help in MCP-powered AI agent workflows?

AI agents can clean user-provided lists, deduplicate search results, or ensure unique values before processing — eliminating manual data cleaning steps.

What happens if I pass an empty array to the unique items tool?

It returns an empty array. No errors, just consistent behavior for edge cases.

Try Unique Items Now

Get your free API key and start using Unique Items in seconds.

Get Free API Key