Validates URL slugs against standard web conventions — lowercase letters, numbers, hyphens only, no leading/trailing hyphens. Use via MCP in Cursor or Windsurf for content validation, or call GET /v1/slug/is-valid-slug with your string. Returns boolean true/false with detailed validation info. Perfect for CMS systems and SEO-friendly URL generation.
curl "https://tinyfn.io/v1/slug/is-valid-slug" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/slug/is-valid-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/slug/is-valid-slug',
headers={'X-API-Key': 'YOUR_API_KEY'})
data = response.json()
print(data)
Connect your AI agent (Claude, Cursor, Windsurf, etc.) to TinyFn's url/slug tools:
{
"mcpServers": {
"tinyfn-slug": {
"url": "https://tinyfn.io/mcp/slug",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}
Valid slugs contain only lowercase letters, numbers, and hyphens. They cannot start or end with hyphens, have consecutive hyphens, or include spaces, uppercase letters, or special characters.
Call the is-valid-slug tool from Cursor, Windsurf, or other MCP clients. Pass your string and get instant validation with specific error details if invalid.
It only validates — returns true/false with error details. Use TinyFn's create-slug tool to generate valid slugs from arbitrary strings.
Slug validation checks URL path segments (like 'my-blog-post'), while URL validation checks complete URLs with protocols, domains, and parameters.
Empty strings return false. Very long slugs may be valid by format but could hit web server limits — check your specific platform's requirements.
Get your free API key and start using Is Valid Slug in seconds.
Get Free API Key