Converts any text into URL-friendly slugs by removing special characters, normalizing spaces to hyphens, and lowercasing. Use via MCP in Cursor or Windsurf for consistent slug generation, or call GET /v1/string/slug directly. Perfect for creating clean URLs from article titles or user input. Handles Unicode normalization and prevents double-hyphens automatically.
curl "https://tinyfn.io/v1/string/slug" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/string/slug', {
headers: { 'X-API-Key': 'YOUR_API_KEY' }
});
const data = await response.json();
console.log(data);
import requests
response = requests.get('https://tinyfn.io/v1/string/slug',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's string tools:
{
"mcpServers": {
"tinyfn-string": {
"url": "https://tinyfn.io/mcp/string",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Strips all non-alphanumeric characters except hyphens, normalizes Unicode to ASCII equivalents where possible, and converts spaces to single hyphens.
Yes, Claude Code can call the slug tool directly on any text input, making it ideal for generating consistent URL slugs from user-generated content or API responses.
Multiple spaces become a single hyphen, consecutive special characters are removed entirely, and the result is trimmed of leading/trailing hyphens.
Always converts to lowercase for maximum URL compatibility and consistency across different systems and platforms.
Creates human-readable slugs rather than percent-encoded strings - 'Hello World!' becomes 'hello-world' instead of 'Hello%20World%21'.