# Deterministic URL Engine MCP for AI Agents AI Agent Connect

> Deterministic URL Engine. Fixes broken links created by AI. It parses URIs, pulls query data, and adds tracking parameters like UTMs perfectly every time. No more double question marks or broken ampersands.

## Overview
- **Category:** productivity
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_icm4wWTdS8cJDs1MvvxdiaRMVKJ9m5v46tLcXCG6/ai-agent-connect
- **Tags:** uri-parsing, url-manipulation, query-string, data-normalization, v8-engine, parameter-injection

## Description

LLMs are notoriously bad at string manipulation. When you ask an agent to add a tracking tag to a URL, it often messes up the syntax, creating links that lead to 404s or broken pages. This Connector takes that responsibility off your agent's plate by using a dedicated engine to handle the heavy lifting. Instead of the AI trying to guess where the question mark or ampersand goes, it hands the URL to this tool. You get perfectly formatted links for your marketing campaigns, data scraping jobs, or internal redirects. It is a small but critical piece of infrastructure that ensures your agent's outputs actually work. It uses a pristine V8 deterministic engine to guarantee that symbols like question marks and ampersands are placed exactly where they belong. This means you can stop worrying about your agent hallucinating broken links or messy strings. You will find this in the Vinkius catalog as a reliable way to handle web addresses without the usual headaches of manual concatenation. It works instantly with your favorite tools to keep your web data clean and your links clickable.

## Tools

### extract_query
Pulls a specific value from a query string without using messy regex. This is perfect for grabbing tokens or IDs from long URLs.

### inject_query
Adds or updates parameters in a URL while ensuring correct symbols. It handles the math of whether to use a question mark or an ampersand automatically.

### parse_url
Breaks a URL into its protocol, host, pathname, and other parts. Use this to identify the base domain or specific path components quickly.

## Prompt Examples

**Prompt:** 
```
Add a utm_source=google tag to this link: https://example.com/shop
```

**Response:** 
```
I've updated the link for you. Here is the new URL:

https://example.com/shop?utm_source=google
```

**Prompt:** 
```
What is the host for this URL: https://sub.example.com:8080/path?id=1
```

**Response:** 
```
The base host for that URL is **example.com**.
```

**Prompt:** 
```
Get the session_id from this: https://site.com/login?user=123&session_id=abc_99
```

**Response:** 
```
The session_id is **abc_99**.
```

## Capabilities

### Add tracking parameters without errors
Inject UTM codes or other query keys into any URL while the engine handles the correct symbols.

### Break URLs into atomic parts
Split a link into its protocol, host, path, and hash for cleaner data processing.

### Grab specific query values
Extract values like session tokens or IDs from long query strings without using regex.

### Handle complex URI structures
Process URLs with ports, hashes, and multiple parameters without any parsing failures.

## Use Cases

### Campaign Link Generation
A marketing manager asks the agent to create a list of 50 links for a summer sale. The agent uses inject_query to add unique UTM codes to each one without creating broken URLs.

### Session Token Extraction
A developer needs to pull a login token from a redirect URL. The agent uses extract_query to grab the 'token' value from a long string of parameters.

### Scraper Host Identification
A data analyst wants to find all unique domains in a list of raw URLs. The agent uses parse_url to strip away paths and queries to find the base host.

### Dynamic Redirect Construction
An app needs to build a safe redirect link for a user. The agent uses inject_query to merge the base path with new user-specific parameters.

## Benefits

- Stop broken links: inject_query ensures symbols like ? and & are always in the right spot every time.
- Clean data extraction: Use extract_query to pull tokens or IDs from messy strings instantly.
- Reliable scraping: parse_url lets your agent identify the host or path without getting tripped up by ports or hashes.
- Faster execution: The engine runs on pure Javascript, so it processes links almost instantly.
- No more regex: You don't have to write complex patterns to find a specific URL parameter.
- Perfect consistency: Every link generated follows the exact same rules, removing the chance of AI hallucination.

## How It Works

The bottom line is your agent stops breaking links and produces usable web addresses.

1. Provide the base URL and the new parameters to your agent.
2. The agent sends these to the Connector to handle the concatenation.
3. You get a perfectly formatted URL back every time.

## Frequently Asked Questions

**How does Deterministic URL Engine fix broken links?**
It uses a dedicated engine to handle URL logic. Instead of the AI guessing where symbols go, the Connector ensures that question marks and ampersands are placed perfectly every time.

**Can Deterministic URL Engine help with UTM parameters?**
Yes. It is specifically designed to inject parameters like UTM codes into existing URLs without creating double symbols or breaking the link.

**Does Deterministic URL Engine support complex URLs with ports?**
Yes. It deconstructs URLs into their core components, including the host, port, and path, so your agent can work with complex addresses reliably.

**How do I use Deterministic URL Engine for data scraping?**
You can use it to pull specific values from long query strings. This helps your agent extract tokens, IDs, or other data points from web links without errors.

**Is Deterministic URL Engine faster than manual parsing?**
It is extremely fast because it runs on a pure Javascript runtime. It processes links almost instantly, making it ideal for high-volume tasks.

**Can Deterministic URL Engine handle multiple query parameters?**
Yes. It can manage multiple parameters at once, ensuring that every new addition is concatenated correctly with the existing ones.

**Why use an Connector instead of letting the AI format the URL?**
AIs are probabilistic text generators, not web browsers. If a URL already has a `?`, adding another parameter requires `&`. LLMs frequently guess the wrong delimiter, breaking critical affiliate tracking or API requests. The Connector guarantees correct serialization.

**Can it extract multiple parameters?**
Yes! If you use the `parse_url` tool, it returns a `queryParams` JSON object containing every single key and value found in the URL. If you only want one, use `extract_query`.

**Does this tool execute network requests?**
No. The entire engine executes pure algorithmic parsing on strings. It does not validate if the URL is active online, it merely processes its mathematical construction.

**Why use an MCP instead of letting the AI format the URL?**
AIs are probabilistic text generators, not web browsers. If a URL already has a `?`, adding another parameter requires `&`. LLMs frequently guess the wrong delimiter, breaking critical affiliate tracking or API requests. The MCP guarantees correct serialization.