Home / Servers / Web and Network / url_build

Url build

An MCP tool from the Web and Network server, hosted on mcp.hjlabs.in.

Build or normalise a URL: start from a base URL, optionally resolve a relative path against it, set/remove query parameters, strip tracking parameters (utm_*, fbclid, gclid...), lower-case the host, drop the fragment or default port. Pure, no network. Use it to construct API calls or clean URLs for comparison.

Name on the gateway: web__url_build · read-only.

Parameters

NameTypeDescription
base requiredstringBase URL, e.g. "https://example.com/api".
pathstringOptional relative or absolute path to resolve against base.
set_paramsanyObject of query parameters to set, e.g. {"q":"cats","page":2}.
remove_paramsarrayQuery parameter names to remove.
strip_trackingbooleanRemove utm_*, fbclid, gclid, msclkid, mc_cid, mc_eid, ref, _ga (default true).
drop_fragmentbooleanRemove the #fragment.
sort_paramsbooleanSort query parameters for a canonical form.

How to call it

Through the Smart Gateway, any client can run it by name with call_tool, or let the gateway find it with search_tools:

call_tool arguments
{
  "name": "web__url_build",
  "arguments": {
    "base": "…"
  }
}

Or connect the Web and Network server directly, which lists 22 tools including this one:

Run in your terminal
claude mcp add --transport http hj-web https://mcp.hjlabs.in/mcp/web \
  --header "Authorization: Bearer YOUR_API_KEY"

Try asking

Use the url build tool with base set to ….

More from Web and Network