This skill is instructions-only. It does not run any code on the device.
When the user asks to shorten a URL, the agent should use the existing
http_fetch tool to call one of the public shortener APIs below and then
return the response body as the short URL.
GET https://da.gd/s?url=<URL-encoded original URL>
Exactly one call. Response body is the short URL as plain text (no JSON).
Extract the original URL from the user's message.
http:// or https://. If not, ask the user to
provide one.URL-encode the original URL (apply encodeURIComponent to it).
Call http_fetch with these parameters:
url: https://da.gd/s?url=<encoded original>method: GETTake the raw response body, strip surrounding whitespace, and verify it
starts with https://da.gd/. If so, return that as the short URL.
If the body doesn't match, or the status is not 2xx, fall back to one of the alternate backends below.
Original:
text
https://github.com/anthropics/claude-code/tree/main/docs/very/long/path
Encoded:
text
https%3A%2F%2Fgithub.com%2Fanthropics%2Fclaude-code%2Ftree%2Fmain%2Fdocs%2Fvery%2Flong%2Fpath
Fetch:
text
http_fetch({ url: "https://da.gd/s?url=https%3A%2F%2Fgithub.com%2Fanthropics%2Fclaude-code%2Ftree%2Fmain%2Fdocs%2Fvery%2Flong%2Fpath", method: "GET" })
Expected response body: https://da.gd/XXXXXX
POST https://cleanuri.com/api/v1/shorten
method: POSTcontent_type: application/x-www-form-urlencodedbody: url=<URL-encoded original URL>Response is JSON: {"result_url": "https://cleanuri.com/XXXXXX"}. Parse and
return result_url.
GET https://tinyurl.com/api-create.php?url=<URL-encoded original URL>
Response body is plain text like https://tinyurl.com/XXXXXX. Some clients
get bot-detected and receive a "deprecated preview" placeholder — if the
response body lies outside the https://tinyurl.com/ domain or redirects
to tinyurl.com/preview/deprecated, treat it as a failure and move on.