Combines multiple path segments into a single, properly formatted path with correct separators. Use via MCP in Cursor or Claude Code, or hit GET /v1/slug/join-path with path parts as parameters. Handles edge cases like trailing slashes, empty segments, and mixed separators. Returns clean, normalized paths for URLs, file systems, or routing.
curl "https://tinyfn.io/v1/slug/join-path" \
-H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/slug/join-path', {
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/join-path',
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"
}
}
}
}
Pass each segment as a separate parameter to join-path. It automatically normalizes separators and removes empty segments, preventing issues like '/api//users/' becoming '/api/users/'.
Yes, AI agents can call join-path through MCP to build URLs programmatically. Especially useful when constructing API endpoints or file paths from variable components without manual string concatenation.
Yes, it normalizes mixed separators to forward slashes and handles both Windows-style backslashes and Unix-style forward slashes consistently.
Empty segments are automatically filtered out, so joining ['api', '', 'users', null] produces '/api/users' instead of '/api//users/'.
Yes, manual concatenation often creates bugs with double slashes or missing separators. Join-path handles edge cases deterministically that manual string building misses.