Skip to main content
Glama

Shorten URL

rustypaste_shorten_url

Shorten long URLs into compact redirect links using the rustypaste service. Convert lengthy web addresses into manageable short URLs for sharing and tracking.

Instructions

Shorten a long URL using rustypaste.

Creates a short redirect URL that points to the original long URL.

Args:

  • url (string): The URL to shorten (must be a valid URL)

Returns: The shortened URL.

Examples:

  • Shorten a link: url="https://example.com/very/long/path/to/resource?with=params"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe long URL to shorten

Implementation Reference

  • The tool handler function for rustypaste_shorten_url, which uses RustypasteClient to shorten the provided URL.
    async (params: Input) => {
        try {
            const client = new RustypasteClient();
            const result = await client.shortenUrl(params.url);
            return {
                content: [
                    {
                        type: "text" as const,
                        text: `✅ URL shortened!\n\nShort URL: ${result.url}\nOriginal:  ${params.url}`,
                    },
                ],
            };
        } catch (error) {
            return {
                isError: true,
                content: [
                    {
                        type: "text" as const,
                        text: `Error: ${error instanceof Error ? error.message : String(error)}`,
                    },
                ],
            };
        }
    }
  • The InputSchema for the tool, validating that the input 'url' is a valid URL string.
    const InputSchema = z.object({
        url: z
            .string()
            .url("Must be a valid URL")
            .describe("The long URL to shorten"),
    });
  • The registration function that defines the 'rustypaste_shorten_url' tool to the MCP server.
    export function registerShortenUrl(server: McpServer): void {
        server.registerTool(
            "rustypaste_shorten_url",
            {
                title: "Shorten URL",
                description: `Shorten a long URL using rustypaste.
    
    Creates a short redirect URL that points to the original long URL.
    
    Args:
      - url (string): The URL to shorten (must be a valid URL)
    
    Returns:
      The shortened URL.
    
    Examples:
      - Shorten a link: url="https://example.com/very/long/path/to/resource?with=params"`,
                inputSchema: InputSchema,
                annotations: {
                    readOnlyHint: false,
                    destructiveHint: false,
                    idempotentHint: false,
                    openWorldHint: true,
                },
            },
            async (params: Input) => {
                try {
                    const client = new RustypasteClient();
                    const result = await client.shortenUrl(params.url);
                    return {
                        content: [
                            {
                                type: "text" as const,
                                text: `✅ URL shortened!\n\nShort URL: ${result.url}\nOriginal:  ${params.url}`,
                            },
                        ],
                    };
                } catch (error) {
                    return {
                        isError: true,
                        content: [
                            {
                                type: "text" as const,
                                text: `Error: ${error instanceof Error ? error.message : String(error)}`,
                            },
                        ],
                    };
                }
            }
        );
    }
Behavior3/5

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

Annotations already indicate this is a non-readOnly, non-destructive, non-idempotent, open-world operation. The description adds that it 'creates a short redirect URL,' which provides context about the output behavior, but doesn't disclose rate limits, authentication needs, or error handling beyond what annotations cover.

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 well-structured with clear sections (purpose, args, returns, examples) and front-loaded key information. It's concise but includes an example that reinforces usage, though some parts like 'Args:' and 'Returns:' could be slightly more integrated into the flow.

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

Completeness4/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 (1 parameter, no output schema), the description adequately covers the purpose and usage with an example. Annotations provide behavioral context, and the schema fully documents parameters, making the description sufficiently complete for this simple tool.

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%, with the schema fully documenting the single 'url' parameter. The description adds minimal value by restating that the URL 'must be a valid URL' and providing an example, but doesn't elaborate beyond what the schema already specifies.

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

Purpose5/5

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

The description clearly states the specific action ('Shorten a long URL') and resource ('using rustypaste'), distinguishing it from sibling tools that handle files, text, or remote uploads. It explicitly mentions creating a redirect URL, which differentiates it from other URL-related tools like oneshot_url.

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?

The description implies usage when needing a shortened URL, but provides no explicit guidance on when to use this tool versus alternatives like rustypaste_oneshot_url. It mentions the tool's purpose but lacks context about sibling tool distinctions or specific scenarios for preference.

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/rukh-debug/rustypaste-mcp'

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