Text Analysis

Remove Duplicate Words

Cleans up text by removing consecutive duplicate words like "the the quick brown" → "the quick brown". Access via MCP in Cursor or Claude Code, or hit GET /v1/text/remove-duplicates with your text. Perfect for cleaning up copy-paste errors, OCR output, or user-generated content where words accidentally repeat.

API Endpoint

GET /v1/text/remove-duplicates

Code Examples

curl "https://tinyfn.io/v1/text/remove-duplicates" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/text/remove-duplicates', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests

response = requests.get('https://tinyfn.io/v1/text/remove-duplicates',
    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 text analysis tools:

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

Learn more about MCP setup →

FAQ

Does remove duplicate words handle case sensitivity?

Yes, it treats words case-insensitively, so 'The THE' becomes just 'The' (preserving the first occurrence's capitalization).

How can I use this in my MCP-enabled AI workflow?

Great for preprocessing text before analysis - your AI agent can clean messy input automatically before sentiment analysis or content processing.

What happens with punctuation when removing duplicate words?

Punctuation stays attached to words, so 'hello, hello world' becomes 'hello, world' - the comma moves with the remaining word.

Does this remove ALL duplicate words or just consecutive ones?

Only consecutive duplicates. 'cat dog cat' stays unchanged, but 'cat cat dog' becomes 'cat dog'.

What's the REST API format for removing duplicate words?

Send GET request to /v1/text/remove-duplicates with text parameter. Returns cleaned text with consecutive duplicates removed.

Try Remove Duplicate Words Now

Get your free API key and start using Remove Duplicate Words in seconds.

Get Free API Key