Breaks down URLs into structured components like protocol, host, path, and query parameters. Available through MCP in Cursor and other AI editors, or via REST at `/v1/slug/parse-url`. Pass any URL and get back a JSON object with separate fields for each part. Essential for URL validation, routing logic, and parameter extraction in web applications.
curl "https://tinyfn.io/v1/slug/parse-url" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/slug/parse-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/parse-url',
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"
}
}
}
}
Returns protocol, hostname, port, pathname, search parameters, hash fragment, and additional metadata like subdomain detection. Handles both absolute and relative URLs with proper component separation.
Yes, supports Unicode domains, encoded characters, and international URLs. Properly decodes percent-encoded characters and handles punycode for internationalized domain names.
The parser automatically separates query string into individual key-value pairs. Access them through the returned object's query or searchParams field, depending on the output format.
Performs basic validation during parsing and flags malformed URLs. Returns error details for invalid protocols, missing components, or syntactically incorrect URLs.
Provides consistent parsing across environments without browser dependencies. Returns standardized output format and handles edge cases that native URL constructors might reject or interpret differently.