URL/Slug Utilities

Add Query Param

Appends query parameters to URLs programmatically via MCP or GET /v1/slug/add-query-param. Pass a base URL and key-value pairs to get properly encoded results like `https://api.com/users?page=2&sort=name`. Handles URL encoding, duplicate parameters, and preserves existing query strings. Essential for dynamic link generation in AI agents and web automation.

API Endpoint

GET /v1/slug/add-query-param

Code Examples

curl "https://tinyfn.io/v1/slug/add-query-param" \
  -H "X-API-Key: YOUR_API_KEY"
const response = await fetch('https://tinyfn.io/v1/slug/add-query-param', {
  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/add-query-param',
    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 add multiple query parameters to a URL?

Pass multiple key-value pairs and the tool will combine them with proper & separators and URL encoding. Existing query parameters are preserved.

What happens if I add a parameter that already exists in the URL?

The tool typically appends the new parameter, creating duplicate keys. Check your specific use case requirements for handling duplicates.

Does the add query param tool handle URL encoding automatically?

Yes, special characters in parameter names and values are automatically URL-encoded to ensure valid URLs.

Can MCP tools like Cursor use this for building API request URLs?

Absolutely. AI agents can dynamically construct URLs with pagination, filters, or search parameters for API calls and web scraping tasks.

What's the difference between this and manually concatenating query strings?

This tool ensures proper URL encoding, handles edge cases like existing parameters, and prevents malformed URLs from string concatenation errors.

Try Add Query Param Now

Get your free API key and start using Add Query Param in seconds.

Get Free API Key