Skip to main content
Glama
thenavidm
by thenavidm

Create a link

create_link
Destructive

Create a short link for the authenticated workspace with optional custom slug, domain, tags, and geo or device targeting. Use it to generate trackable URLs for sharing and campaigns.

Instructions

Create a link for the authenticated workspace.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geoNoGeo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information.
iosNoThe iOS destination URL for the short link for iOS device targeting.
keyNoThe short link slug. If not provided, a random 7-character slug will be generated.
refNoThe referral tag of the short link. If set, this will populate or override the `ref` query parameter in the destination URL.
urlNoThe destination URL of the short link.
imageNoThe custom link preview image (og:image). Will be used for Custom Link Previews if `proxy` is true. Learn more: https://d.to/og
proxyNoWhether the short link uses Custom Link Previews feature. Defaults to `false` if not provided.
tagIdNoDeprecated: Use `tagIds` instead. The unique ID of the tag assigned to the short link.
titleNoThe custom link preview title (og:title). Will be used for Custom Link Previews if `proxy` is true. Learn more: https://d.to/og
videoNoThe custom link preview video (og:video). Will be used for Custom Link Previews if `proxy` is true. Learn more: https://d.to/og
domainNoThe domain of the short link (without protocol). If not provided, the primary domain for the workspace will be used (or `dub.sh` if the workspace has no domains).
prefixNoThe prefix of the short link slug for randomly-generated keys (e.g. if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key` is provided.
tagIdsNoThe unique IDs of the tags assigned to the short link.
accountNoExact configured private workspace profile label; not a tenant or provider account ID.
androidNoThe Android destination URL for the short link for Android device targeting.
confirmNoMust be true for the requested mutation or exclusive private output file.
doIndexNoAllow search engines to index your short link. Defaults to `false` if not provided. Learn more: https://d.to/noindex
payloadNoComplete native JSON body; do not mix with body flags or payload_file. Arrays use repeated JSON object flags or a whole native array in a private file.
rewriteNoWhether the short link uses link cloaking. Defaults to `false` if not provided.
archivedNoWhether the short link is archived. Defaults to `false` if not provided.
commentsNoThe comments for the short link.
folderIdNoThe unique ID existing folder to assign the short link to.
passwordNoThe password required to access the destination URL of the short link.
tagNamesNoThe unique name of the tags assigned to the short link (case insensitive).
tenantIdNoThe ID of the tenant that created the link inside your system. If set, it can be used to fetch all links for a tenant. Pass `null` or an empty string to remove it.
utm_termNoThe UTM term of the short link. If set, this will populate or override the UTM term in the destination URL.
expiresAtNoThe date and time when the short link will expire at.
keyLengthNoThe length of the short link slug. Defaults to 7 if not provided. When used with `prefix`, the total length of the key will be `prefix.length + keyLength`.
partnerIdNoThe ID of the partner the short link is associated with.
programIdNoThe ID of the program the short link is associated with.
expiredUrlNoThe URL to redirect to when the short link has expired.
externalIdNoThe ID of the link in your database. If set, it can be used to identify the link in future API requests (must be prefixed with 'ext_' when passed as a query parameter). This key is unique across your workspace. Pass `null` or an empty string to remove it.
utm_mediumNoThe UTM medium of the short link. If set, this will populate or override the UTM medium in the destination URL.
utm_sourceNoThe UTM source of the short link. If set, this will populate or override the UTM source in the destination URL.
webhookIdsNoDeprecated: You can now enable link.clicked webhooks for all links in a workspace or folder without passing this field manually. An array of webhook IDs to trigger when the link is clicked. These webhooks will receive click event data.
descriptionNoThe custom link preview description (og:description). Will be used for Custom Link Previews if `proxy` is true. Learn more: https://d.to/og
publicStatsNoDeprecated: Use `dashboard` instead. Whether the short link's stats are publicly accessible. Defaults to `false` if not provided.
utm_contentNoThe UTM content of the short link. If set, this will populate or override the UTM content in the destination URL.
payload_fileNoAbsolute regular non-symlink JSON body file, at most 1 MiB. Cannot mix with payload/body flags.
testVariantsNoAn array of A/B test URLs and the percentage of traffic to send to each URL.
utm_campaignNoThe UTM campaign of the short link. If set, this will populate or override the UTM campaign in the destination URL.
testStartedAtNoThe date and time when the tests started.
testCompletedAtNoThe date and time when the tests were or will be completed.
trackConversionNoWhether to track conversions for the short link. Defaults to `false` if not provided.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=false, destructiveHint=true, idempotentHint=false, and openWorldHint=true, so the safety profile is covered by structured data. The description adds only the workspace scope and omits behaviorally important details the schema hints at, such as the `confirm` requirement for the mutation and the payload vs. body-flag exclusivity rules.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single short sentence with no filler, and the resource is front-loaded. It is efficient, though its brevity edges toward under-specification rather than true conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a high-complexity mutation tool with 44 parameters, nested objects, mutually exclusive body forms, and no output schema, yet the description conveys only that a link is created. An agent is left to infer the confirm requirement, payload exclusivity, and the difference from upsert_link entirely from the schema and annotations.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so every one of the 44 parameters is already documented in the schema, and the baseline for this case is 3. The description contributes nothing about parameters (e.g., that `url` is the core destination or how `payload`/`payload_file` interact), so it neither helps nor hurts.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description gives a clear verb+resource ('Create a link') and scopes it to 'the authenticated workspace', so an agent knows what operation it performs. However, it does nothing to distinguish this from siblings like upsert_link, bulk_create_links, or create_partner_link, which all sound like link creation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use guidance at all. With upsert_link and bulk_create_links in the sibling set, the agent gets no signal about when a single create is preferable, nor any note about prerequisites such as the `confirm` flag or workspace context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.