Skip to main content
Glama

Shorten URL

shorten_url

Shorten a long URL. Deduplicates automatically — shortening the same URL twice returns the existing link. Every link is namespace-aware: every user gets a prefix, so stats are kept if the plan changes. Supports routing rules, OG meta, geo-restriction, password protection, and ad-click-ID passthrough (available on Pro plans and higher).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "url": "<url>"
    },
    "name": "shorten_url"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesThe long URL to shorten (http or https)
og_metaNoOverride Open Graph tags for social media previews. Pro+.
passwordNoOptional password to protect this link (min 4 chars). Visitors must enter the password before being redirected. Pro+.
expires_atNoOptional ISO-8601 expiry datetime, e.g. "2026-12-31T23:59:59Z"
max_clicksNoOptional click cap — link deactivates after this many clicks
custom_slugNoOptional human-readable slug, e.g. "product-launch". Requires a Starter plan or higher.
override_scanNoWhen true, creates the link even if the URL trust score is below the safety threshold (score < 40). Use with caution — the link is saved disabled and does not redirect until it has been reviewed.
routing_rulesNoConditional routing: redirect visitors to different destinations based on device, OS, country, or language. Pro+ (5 rules), Builder+ (20 rules).
geo_restrictionNoAllow or block access by country. Pro+.
pass_ad_click_idsNoWhen true, appends gclid/fbclid/ttclid parameters from the original click to the destination URL.
expire_fallback_urlNoOptional URL to redirect visitors to when this link expires, instead of showing the expiry error page. Must not create a circular redirect. Pro+ only.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / override_scan / description
      Previous value: -"When true, creates the link even if the URL trust score is below the safety threshold (score < 40). Use with caution — the link will display a caution badge."New value: +"When true, creates the link even if the URL trust score is below the safety threshold (score < 40). Use with caution — the link is saved disabled and does not redirect until it has been reviewed."
  2. First observed

TDQS

B3/5.0
Behavior1/5

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

The annotations declare idempotentHint=false, yet the description says shortening the same URL twice returns the existing link. That implies repeated identical calls have no additional effect, which contradicts the annotation. The description also does not explain the successful return shape or authentication requirements.

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?

The description is front-loaded with the core action and keeps the deduplication and namespace behavior early. The final feature inventory partly repeats schema details, but it remains concise enough to serve as an overview.

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

Completeness3/5

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

For an 11-parameter creation tool with nested objects, the description covers purpose, deduplication, namespace behavior, and plan gating. However, it omits the successful response shape and auth/permission context, and no output schema exists to fill that gap.

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%, including nested routing and geo-restriction fields, so the schema already carries most parameter semantics. The prose adds useful plan-tier and deduplication context, but it does not add syntax or meaning beyond the detailed schema.

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 states a specific verb and resource: it shortens a long URL into a link. It also adds scope around deduplication, namespace prefixes, and optional features, but it does not explicitly distinguish single-link creation from sibling tools such as bulk_shorten.

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

Usage Guidelines3/5

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

Usage is implied through deduplication behavior and Pro+ feature availability, but there is no explicit when-to-use/when-not guidance. The agent must infer that this tool is for one URL while bulk_shorten is likely for many.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources