URL/Slug Utilities

Normalize Url

Converts URLs to a standardized canonical format by removing query parameters, fragments, and redundant elements. Use via MCP in Cursor or Windsurf, or call GET /v1/slug/normalize-url with your URL. Example: "https://example.com/page/?utm=123#section" becomes "https://example.com/page/". Essential for deduplication, caching, and consistent URL handling across AI agent workflows.

API Endpoint

GET /v1/slug/normalize-url

Code Examples

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

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

Learn more about MCP setup →

FAQ

What does URL normalization remove from URLs?

Removes query parameters, URL fragments (#sections), trailing slashes inconsistencies, and redundant path elements like '..' and '.'. Preserves the core path structure.

How do I normalize URLs in MCP-enabled editors like Cursor?

Call the normalize-url tool with your URL as input. The MCP tool returns the canonical form immediately, perfect for AI agents processing web data.

Does URL normalization handle international domain names?

Yes, it properly handles IDNs and Unicode characters in URLs, converting them to their canonical ASCII representation when needed.

Can I normalize multiple URLs at once?

No, the tool processes one URL per request. For bulk operations, make multiple calls or use it within AI agent loops.

What happens to invalid or malformed URLs?

The tool attempts to parse and normalize what it can, but severely malformed URLs may return an error or the original input unchanged.

Try Normalize Url Now

Get your free API key and start using Normalize Url in seconds.

Get Free API Key