# URL resolve

`url-resolve` · version 1.0.0 · URLs & IP addresses · free, no key needed

Resolve a URL against an absolute http(s) base using WHATWG. No fetching. Result must be http(s).

**Use when you need to: url resolve · resolve relative url · join url against base.**

## Supported

- url resolve
- resolve relative url
- join url against base

## Not supported

- fetch
- dns
- file urls
- security equivalence

## Behavior

- base must be an absolute http or https URL. url is resolved with new URL(url, base).
- The resolved href must have http or https scheme; otherwise invalid_input.
- Return WHATWG href serialization. No extra normalize beyond WHATWG resolve/serialize unless the result is returned as href.
- No network and no security-equivalence claim.

## Input

- `base` (string, required): min length 1; max length 8192
- `url` (string, required): min length 1; max length 8192

## Output

- `url` (string, required)

## Limits

- max url bytes: 8192

## Example

Request input:

```json
{
  "base": "https://example.com/a/b",
  "url": "../c"
}
```

Response:

```json
{
  "result": {
    "url": "https://example.com/c"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "url-resolve",
  "version": "1.0.0",
  "input": {
    "base": "https://example.com/a/b",
    "url": "../c"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/url-resolve/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"base":"https://example.com/a/b","url":"../c"}'
```

The machine-readable contract is at [/v1/tools/url-resolve/versions/1.0.0](/v1/tools/url-resolve/versions/1.0.0).

### CLI

```sh
node cli.mjs run url-resolve 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [URL normalize](/tools/url-normalize): Normalize an absolute http or https URL via WHATWG parse. No DNS, fetch, or security-equivalence claim.
- [URL query build](/tools/url-query-build): Build a query string or replace an absolute URL query from ordered pairs. No fetching.
- [URL query merge](/tools/url-query-merge): Merge query pairs into an absolute URL. No fetching.
- [URL query parse](/tools/url-query-parse): Parse query pairs and fragment from an absolute URL. Parse only; no fetching.
- [IPv4 address classify](/tools/ipv4-address-classify): Classify an IPv4 address against the static IANA IPv4 special-purpose address registry.
- [IPv4 address compare](/tools/ipv4-address-compare): Compare two canonical IPv4 addresses by their numeric uint32 value.
