URL/Slug Utilities

Build Url

Constructs URLs from separate components like protocol, host, path, and query parameters. Access via MCP in Cursor or Windsurf, or REST API at GET /v1/slug/build-url. Pass components as parameters to get back a properly formatted URL string. Handles encoding, trailing slashes, and parameter serialization automatically.

API Endpoint

GET /v1/slug/build-url

Code Examples

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

How do I build a URL with query parameters using the build-url tool?

Pass query parameters as key-value pairs and the tool automatically encodes them into the URL query string with proper formatting and encoding.

Can MCP agents use build-url to construct API endpoints dynamically?

Yes, AI agents in Cursor, Claude Code, and other MCP-enabled editors can build URLs programmatically for API calls, webhooks, or redirect URLs.

Does build-url handle special characters and encoding automatically?

Yes, it properly URL-encodes special characters in paths, query parameters, and fragments according to RFC standards.

What happens if I don't provide a protocol when building a URL?

The tool typically defaults to 'https://' if no protocol is specified, but check the specific parameter requirements for your use case.

Can I build URLs with fragments (hash values) using this tool?

Yes, you can include fragment components and the tool will append them correctly with the # symbol and proper encoding.

Try Build Url Now

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

Get Free API Key