Skip to main content
Glama
Talismanic

URL Shortener MCP

shorten

Convert long URLs into shorter, shareable links using the CleanURI API for easier distribution and management.

Instructions

Shorten a URL using the cleanuri API.

Args:
    original_url: The URL to shorten.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
original_urlYes

Implementation Reference

  • main.py:24-34 (handler)
    The main handler for the 'shorten' tool, registered via @mcp.tool() decorator. It invokes the helper to shorten the URL and returns the result or error message.
    @mcp.tool()
    async def shorten(original_url: str) -> str | None:
        """Shorten a URL using the cleanuri API.
    
        Args:
            original_url: The URL to shorten.
        """
        shortened_url = await shorten_url(original_url)
        if not shortened_url:
            return "Unable to shorten the URL."
        return shortened_url
  • main.py:9-21 (helper)
    Supporting helper function that performs the actual HTTP request to the cleanuri API to obtain the shortened URL.
    async def shorten_url(original_url: str) -> str | None:
        headers = {"Content-Type": "application/x-www-form-urlencoded"}
        data = {"url": original_url}
    
        async with httpx.AsyncClient() as client:
            try:
                response = await client.post(CLEANURI_API_URL, data=data, headers=headers, timeout=30.0)
                response.raise_for_status()
                result: dict[str, Any] = response.json()
                return result.get("result_url")
            except Exception as e:
                print(f"An error occurred: {e}")
                return None
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states this is a URL shortening operation but doesn't disclose behavioral traits like whether this requires authentication, rate limits, what happens with invalid URLs, or what the output format looks like. The mention of 'cleanuri API' adds minimal context but lacks operational details.

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

Conciseness5/5

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

The description is appropriately sized and front-loaded: the first sentence states the core purpose, and the second provides parameter documentation. There's zero wasted text, and the structure is clear with a brief introduction followed by args.

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?

Given the tool's low complexity (single parameter, no annotations, no output schema), the description is minimally adequate. It covers the basic purpose and parameter, but lacks important context like output format, error handling, or API constraints. Without an output schema, the description should ideally hint at what gets returned.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It explicitly documents the single parameter 'original_url' with a clear explanation ('The URL to shorten'), which adds meaningful semantics beyond the bare schema. However, it doesn't provide format examples or validation rules (e.g., must be a valid HTTP URL).

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 clearly states the tool's purpose with a specific verb ('shorten') and resource ('URL'), and identifies the external service ('cleanuri API'). It doesn't need to distinguish from siblings since there are none. However, it could be slightly more specific about what type of shortening service cleanuri provides.

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?

The description provides no guidance on when to use this tool versus alternatives (though there are no sibling tools). It doesn't mention prerequisites, rate limits, or any constraints. The only usage context is the API name, which is insufficient for proper guidance.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Talismanic/cleanuri-url-shortener-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server