Case Conversion Utilities

Swap Case

Inverts the case of every character in a string — uppercase becomes lowercase and vice versa. Access via MCP in Cursor or Windsurf for text processing tasks, or call GET /v1/case/swap directly. Perfect for creating alternating case patterns or preprocessing text data where case inversion is needed programmatically.

API Endpoint

GET /v1/case/swap

Code Examples

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

response = requests.get('https://tinyfn.io/v1/case/swap',
    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 case conversion tools:

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

Learn more about MCP setup →

FAQ

How does swap case handle mixed case strings?

Each character is individually inverted: 'Hello World' becomes 'hELLO wORLD'. Uppercase letters become lowercase, lowercase become uppercase, and non-alphabetic characters remain unchanged.

What happens to numbers and special characters in swap case?

Numbers, spaces, punctuation, and symbols are preserved exactly as-is. Only alphabetic characters (a-z, A-Z) have their case swapped.

Can I use swap case with MCP agents for text preprocessing?

Yes, it's available as an MCP tool in Cursor, Claude Code, and other editors. Useful for creating test data, formatting challenges, or preprocessing text before further transformations.

Does swap case work with Unicode characters?

Yes, it handles Unicode properly. Characters like 'Ñ' become 'ñ', and accented characters maintain their accents while swapping case according to Unicode rules.

What's the difference between swap case and toggle case?

They're the same operation — both terms refer to inverting each character's case individually. Some systems use 'toggle' while others use 'swap' for this transformation.

Try Swap Case Now

Get your free API key and start using Swap Case in seconds.

Get Free API Key